Question :Why would a client application use JTA transactions? (JTA)
Answer :One possible example would be a scenario in which a client needs to
employ two (or more) session beans, where each session bean is deployed
on a different EJB server and each bean performs operations against
external resources (for example, a database) and/or is managing one or
more entity beans. In this scenario, the client's logic could required an allor-
nothing guarantee for the operations performed by the session beans;
hence, the session bean usage could be bundled together with a JTA
UserTransaction object.
In the previous scenario, however, the client application developer should
address the question of whether or not it would be better to encapsulate
these operations in yet another session bean, and allow the session bean to
handle the transactions via the EJB container. In general, lightweight clients
are easier to maintain than heavyweight clients. Also, EJB environments are
ideally suited for transaction management.
...
Context c = new InitialContext(); UserTransaction ut =
(UserTransaction) c.lookup("java:comp/UserTransaction");
ut.begin(); // perform multiple operations...
ut.commit()
...
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Saturday, March 14, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment