Return-Path: Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 1982 invoked by uid 500); 4 Aug 2003 13:38:46 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 1923 invoked from network); 4 Aug 2003 13:38:46 -0000 Received: from secfw12.sec.gov (12.40.163.231) by daedalus.apache.org with SMTP; 4 Aug 2003 13:38:46 -0000 Received: by secfw12.sec.gov; id h74Dcld17520; Mon, 4 Aug 2003 09:38:47 -0400 Received: from exchange2.sec.gov(162.138.65.52) by secfw12.sec.gov via smap id xma017186; Mon, 4 Aug 03 09:37:32 -0400 Received: by opc-sec-mt1.sec.gov with Internet Mail Service (5.5.2653.19) id ; Mon, 4 Aug 2003 09:37:31 -0400 Message-ID: From: "Keeney, Thomas" To: "'Apache Torque Users List'" Subject: RE: How to creat a Transaction to add or delete muti-Table Data? Date: Mon, 4 Aug 2003 09:37:30 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Michel, If you want transactions to work, you must pass the Connection you retrieve from the Transaction class as the save() method parameter. Transaction support works fine in Torque 3.0, so I'm sure it's still good for 3.1. I tested it myself by setting up an insert (save()) on two separate tables, using the same Connection object. One of the tables had all the correct data, whereas I did not include a value in the second table where there was a non-nullable field. This caused the insert on the second table to fail, and the insert on the first table rolled back. Test it yourself. Of course, you have to make sure your database supports transactions (eg MySQL with InnoDB). Tom -----Original Message----- From: Michel Beijlevelt / Lucka [mailto:mbe@lucka.nl] Sent: Monday, August 04, 2003 3:25 AM To: Apache Torque Users List Subject: Re: How to creat a Transaction to add or delete muti-Table Data? Howdy, I you search the archives, there's some information about transcations, but very little actually. I did find something like this: Connection conn = Transaction.begin( FactextraoptionsPeer.DATABASE_NAME ); extraoptions.save(); contract.save(); Transaction.commit( conn ); But I haven't seen any proof in the logs that the transactional statements are actually generated, so I doubt if it really works. gr. Michel PS Transaction is from: import org.apache.torque.util.Transaction; sailorhero wrote: >I use torque at MSSAL server.I want to create a Transcation to add or delete multi-Table Data. >How to create this Transaction? >Please give me a example .Thanks very much! > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org