db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Re: Torque BaseXXX in Transaction and the isNew() Method Check
Date Wed, 20 Oct 2004 20:49:48 GMT
T E Schmitz <mailreg@numerixtechnology.de> 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 <mailreg@numerixtechnology.de>
>Reply-To: mailreg@numerixtechnology.de
>To: Apache Torque Users List <torque-user@db.apache.org>

>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.
>> 
>> <snip>
>> 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


Mime
View raw message