FYI: the change in Object.vm was the addition of three lines (in two places) to fix this bug:

    public void save(DBConnection dbCon) throws TorqueException
    {
  #if ($complexObjectModel)
      if (!alreadyInSave)
      {
        alreadyInSave = true;
        try{       -------------------> this is the first added line

      ..............

      }finally{     -------------------> this is the second added line
            alreadyInSave = false;
     }             -------------------> this is the second added line

FYI: this object.vm is from the 3.0b2 release.


>This bug consistently happens. The following simple scenario reproduces it:
>
>Table A, has only one key, id, which is the primary key (and thus null is
>not allowed).
>Table A maps to Object Foo
>
>try{
>       Foo bug = new Foo();
>       Foo.save() // throws an exception
>}catch(Exception e){
>       //exeption caught, null not allowed
>}
>
>//now user goes about to fix the problem
>test.setId("testid");
>set.save();
>
>it pretends as if save was successful and returns immediately. However, in
>the first save call, the variable "already_in_save" was set to true, then
>exception occurred, and variable was not set to false.
>
>in the second save, it goes and sees that "already_in_save" is true and
>never initiates the save...thus no entry in database, save "pretends" to
>succeed, and no error is reported.
>
>Attached is the modification to Object.vm that fixes this.
>
>Regards,
>
>Joy
>
>Joy Alamgir
>email: [EMAIL PROTECTED]
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Attachment: Object.vm
Description: Binary data


Joy Alamgir
email: [EMAIL PROTECTED] 
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


Reply via email to