Transaction in java control??

Advertisement
hi, all.
I've wrote a custom java control which include several database operations, and I want these operations be wrapped in transactions.
I get information from the document that implicit transaction is provided by workshop.
but unfortunately, I found that when a database operation failed, no rollback happened.
I have search about this problem in this newsgroup, but can't get useful information.
Can someone help me?
Advertisement

Replay

zheng vl wrote:
hi, all.
I've wrote a custom java control which include several database operations, and I want these operations be wrapped in transactions.
I get information from the document that implicit transaction is provided by workshop.
but unfortunately, I found that when a database operation failed, no rollback happened.
I have search about this problem in this newsgroup, but can't get useful information.
Can someone help me?I've taken care of this in my pageflow by explicitly getting a
UserTransaction object from an InitialContext object, as follows
InitialContext itx = new InitialContext();
UserTransaction ut =
(UserTransaction)itx.lookup("javax.transaction.UserTransaction");
ut.begin();
This should get you started.
hth
Mike