🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.database
Article #205

Re: how to use database.executeStatement in a transaction

#205
From: 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
====================================================
Technical Details
Message-ID: <449c2cd0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <449a1470$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,5919d00e4a621fdd
X-Google-Attributes: gid1073da,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 23 Jun 2006 11:02:57 -0700
From: "John Moore (TeamB)" <jbm@microps.com>
User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.database
Subject: Re: how to use database.executeStatement in a transaction
References: <449a1470$1@newsgroups.borland.com>
In-Reply-To: <449a1470$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 207.137.13.178
Message-ID: <449c2cd0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1151085776 207.137.13.178 (23 Jun 2006 11:02:56 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail