Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 36573 invoked from network); 25 Nov 2005 09:05:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Nov 2005 09:05:02 -0000 Received: (qmail 43588 invoked by uid 500); 25 Nov 2005 09:05:00 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 43573 invoked by uid 500); 25 Nov 2005 09:05:00 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 43562 invoked by uid 99); 25 Nov 2005 09:05:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2005 01:05:00 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [194.175.229.106] (HELO mail.seitenbau.net) (194.175.229.106) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2005 01:06:31 -0800 Received: from [195.127.188.18] (helo=www.seitenbau.net) by router1.seitenbau.net with esmtp (Exim 4.43) id 1EfZVQ-0003HW-67 for torque-user@db.apache.org; Fri, 25 Nov 2005 10:04:32 +0100 In-Reply-To: <5EE5137D79A3CA45970354F512B3F3E339E798@m-ex1.gt.local> Subject: RE: Torque, Transactions and Container (Bea) To: "Apache Torque Users List" X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: Thomas Fischer Date: Fri, 25 Nov 2005 10:04:31 +0100 X-MIMETrack: Serialize by Router on www/seitenbau(Release 6.5.1|January 21, 2004) at 25.11.2005 10:04:32 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Sorry, I have no idea how the container handles its transaction. Are you sure it does not use the jdbc transaction mechanisms? Torque does not have its own transaction mechanism, it uses jdbc transactions. To be honest, I do not know how jdbc transactions can de 'disabled'. To explain that: The transactional behaviour is different for different databases. E.g. for oracle, the first select/update/insert... command automatically starts a transaction, whatever you do. For older mysql, for example, you do not have transactions at all, i.e. all you have is an autocommit sort of behaviour. In any case, the changes will have to be committed at the end, be it automatically after each command, or be it manually by issuing a commit on the connection, otherwise any changes you do will not hit the database. But maybe the container does the final commit, although I have no idea how the container should know when the transaction starts and when it ends. If the container commits, I would guess your code is correct. Thomas "Vitzethum, Daniel" schrieb am 24.11.2005 13:00:20: > Hello all, > > a question concerning Torque and Transaction handling. We are > using Torque 3.1 with Bea 8.1. Tx should be handled by the > Container. What is the best strategy to disable Torque's own > transaction? > > I've been playing around with Transaction.beginOptional(), > but don't like to do these calls in every finder or save method. > Is there a property to set? Or a hook to get into? > > This is how I would solve it by now: > > ----- > Connection conn = Transaction.beginOptional(Torque.getDefaultDB(), > false); > conn.setAutoCommit(false); > MyPeer.doInsert/Update/Delete(Criteria, conn); > Torque.closeConnection(conn); > ------ > > > Thx for your help, > > Daniel > > > --------------------------------------------------------------------- > 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