🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.database
2 messages
2 total messages Started by kei Thu, 22 Jun 2006 03:54
how to use database.executeStatement in a transaction
#203
Author: kei
Date: Thu, 22 Jun 2006 03:54
8 lines
1247 bytes
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
#205
Author: John Moore (TeamB)
Date: Fri, 23 Jun 2006 18:02
22 lines
1792 bytes
kei wrote:
> 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:
http://www.microps.com/mps/paperFAQ.html
====================================================
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads