Board index » jbuilder » how to use database.executeStatement in a transaction

how to use database.executeStatement in a transaction


2006-06-22 11:54:24 AM
jbuilder5
as caption, I know there is a method saveChanges(DataSet
[] dataSets, boolean doTransactions) for saving QueryDataSet in
a transaction, but is there a method to include database.executeStatement in a transaction?
what I want to do is delete some record in a table, then add
some record in a table, but these two action must be in a transaction, that is, both success or both fail, how to do?
Thx!!
 
 

Re:how to use database.executeStatement in a transaction

kei wrote:
Quote
as caption, I know there is a method saveChanges(DataSet
[] dataSets, boolean doTransactions) for saving QueryDataSet in
a transaction, but is there a method to include database.executeStatement in a transaction?
what I want to do is delete some record in a table, then add
some record in a table, but these two action must be in a transaction, that is, both success or both fail, how to do?

Thx!!
Have you tried
database.setAutoCommit(false);
...etc...
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/paperFAQ.html
====================================================