Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 96167 invoked from network); 20 Oct 2004 20:49:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Oct 2004 20:49:53 -0000 Received: (qmail 22730 invoked by uid 500); 20 Oct 2004 20:49:53 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 22543 invoked by uid 500); 20 Oct 2004 20:49:51 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 22529 invoked by uid 99); 20 Oct 2004 20:49:51 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [194.77.152.181] (HELO mail.hometree.net) (194.77.152.181) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 20 Oct 2004 13:49:51 -0700 Received: from tangens.hometree.net (mail.hometree.net [194.77.152.181]) by mail.hometree.net (8.12.11/8.12.11) with ESMTP id i9KKnmxr009150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 20 Oct 2004 22:49:48 +0200 Received: (from news@localhost) by tangens.hometree.net (8.12.11/8.12.11/Submit) id i9KKnmf4009148 for torque-dev@db.apache.org; Wed, 20 Oct 2004 22:49:48 +0200 To: torque-dev@db.apache.org Path: not-for-mail From: "Henning P. Schmiedehausen" Newsgroups: hometree.jakarta.torque.dev Subject: Re: Torque BaseXXX in Transaction and the isNew() Method Check Date: Wed, 20 Oct 2004 20:49:48 +0000 (UTC) Organization: INTERMETA - Gesellschaft fuer Mehrwertdienste mbH Lines: 61 Message-ID: References: <4172B0B9.5040300@numerixtechnology.de> Reply-To: hps@intermeta.de NNTP-Posting-Host: forge.intermeta.de X-Trace: tangens.hometree.net 1098305388 8847 194.77.152.164 (20 Oct 2004 20:49:48 GMT) X-Complaints-To: news@intermeta.de NNTP-Posting-Date: Wed, 20 Oct 2004 20:49:48 +0000 (UTC) X-Copyright: (C) 1996-2005 Henning Schmiedehausen User-Agent: nn/6.6.5 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N T E Schmitz writes: >Hello Henning, >I would like to add a few notes to the transaction/rollback discussion >which we had a few weeks back. >-------- Original Message -------- >Subject: Re: Torque BaseXXX in Transaction and the isNew() Method Check >Date: Mon, 27 Sep 2004 09:49:48 +0100 >From: T E Schmitz >Reply-To: mailreg@numerixtechnology.de >To: Apache Torque Users List >Good morning Henning, >Henning P. Schmiedehausen wrote: >>>What exactly do you mean by "lastState" property? >>>Do you mean a shadow object that allows youto fall back to the last >>>saved state? >> >> >> No, no, much easier. Basically. >> >> >> so if you have to roll back a transaction, you can do >> myObject.setNew(myObject.isLastNew()); >> >> And restore the "new" state of the object before a transaction. If you >> want complete rollback, then you would need a shadow object, right. I >> consider this outside the scope of Torque. >To handle a rollback situation just resetting the isNew flag isn't >enough. The other thing that is changed after a successful INSERT are >the primary key properties. If you use SEQUENCEs the PK columns are null >prior to save and the are populated by doInsert(). Only upon successful >completion of the transaction can the new flag and PKs be set! If I remember our discussion correctly, we were talking about veto'ing the insert/update before anything actually hits the database / in a rollback situation. Once something had actually hit the DB and changed the state, then yes, you are correct. Torque does not handle this case and I don't see any simple way to do so. Regards Henning -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/ RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire Linux, Java, perl, Solaris -- Consulting, Training, Development "Fighting for one's political stand is an honorable action, but re- fusing to acknowledge that there might be weaknesses in one's position - in order to identify them so that they can be remedied - is a large enough problem with the Open Source movement that it deserves to be on this list of the top five problems." -- Michelle Levesque, "Fundamental Issues with Open Source Software Development" --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org