EJB.B.1 Client-Demarcated Transactions


The EJB 1.0 specification did not explain how a client other than another enterprise bean can obtain the javax.transaction.UserTransaction interface.

The Java2, Enterprise Edition specification [EJB.10] defines how a client can obtain the javax.transaction.UserTransaction interface using JNDI.

The following is an example of how a Java application can obtain the javax.transaction.UserTransaction interface.

 ...  Context ctx = new InitialContext();  UserTransaction utx =     (UserTransaction)ctx.lookup("java:comp/UserTransaction");  //  // Perform calls to enterprise beans in a transaction.  //  utx.begin();  ... call one or more enterprise beans  utx.commit();  ... 


Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net