I have a session bean with methods that changes its state.

//cart is session bean
ShoppingCart cart = ...
try {
        transaction.begin();
        System.out.println(cart.getVariable());//returns "b" here before
trying to change state.
        //first method call (successful)
        cart.setVariable("x");
        //second method call (generates error)
        cart.setVariable("y");
      transaction.commit();
} catch (Exception e) {
        transaction.rollback();
}

Now if the call to the second method generates an error, I would like to
bean to be rolled back to it pre-existing state.  I would like to exit the
transaction rollback to where my variable is "b" again.

I have set the ejb.transactionAttribute to all the different possible
values, especially "BeanManaged".
Sometimes it just hangs....
I would definitely appreciate a pointer.  Thanks!










~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to