Calling local interface methods  Serializing and deserializing bean proxies

Chapter 8: Creating Enterprise JavaBeans Clients

Managing transactions

EJB clients can begin transactions using the javax.transaction.UserTransaction interface. Obtain an instance from the initial naming context by resolving the name javax.transaction.UserTransaction. For example:

import javax.transaction.*;
import javax.naming.*;

Context ctx;

... ctx has been initialized ...
UserTransaction uTrans = 
   (UserTransaction) ctx.lookup(

You can call the begin(), commit(), and rollback() methods to begin and end transactions. You can enlist multiple component methods in a transaction, with these restrictions:

Copyright © 2005. Sybase Inc. All rights reserved. Serializing and deserializing bean proxies