Crap, I forgot to attach the patches. Sorry about that.

- Stephen

> -----Original Message-----
> From: Stephen Haberman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 18, 2002 4:16 PM
> To: [EMAIL PROTECTED]
> Subject: [patch] rolling back bad connections in save
> 
> In the generated save method, if an error occurs,
> BasePeer.rollBackTransaction is called. However, if an error occurs in
> the rollBackTransaction, the user loses anything about the original
> error and only sees the rollBackEx.
> 
> I've attached two patches:
> 
> torque-rollback-save.txt -- Ignores the rollBackEx and just returns
the
> original exception from save
> 
> torque-rollback-save-notify.txt -- Returns a new TorqueException with
> the text of the original save exception appended with the text of the
> rollBackEx so that the user at least knows the rollBackEx occurred.
> 
> I personally like the first patch, but if rollBackEx are a big deal
and
> somehow reflect an error in the database, then the second patch would
be
> more appropriate.
> 
> - Stephen
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>

Index: src/templates/om/ObjectWithManager.vm
===================================================================
RCS file: 
/home/cvspublic/jakarta-turbine-torque/src/templates/om/ObjectWithManager.vm,v
retrieving revision 1.11
diff -r1.11 ObjectWithManager.vm
825,826c825,836
<             BasePeer.rollBackTransaction(con);
<             throw e;
---
>             try
>             {
>                 BasePeer.rollBackTransaction(con);
>              }
>              catch (Exception rollBackEx)
>              {
>                  throw new TorqueException(e.getMessage() 
>                      + "; a rollback exception ocurred when rolling back the error: "
>                      + rollBackEx.getMessage(),
>                      e);
>              }
>              throw e;
Index: src/templates/om/Object.vm
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/src/templates/om/Object.vm,v
retrieving revision 1.33
diff -r1.33 Object.vm
821,822c821,832
<             BasePeer.rollBackTransaction(con);
<             throw e;
---
>             try
>             {
>                 BasePeer.rollBackTransaction(con);
>              }
>              catch (Exception rollBackEx)
>              {
>                  throw new TorqueException(e.getMessage() 
>                      + "; a rollback exception ocurred when rolling back the error: "
>                      + rollBackEx.getMessage(),
>                      e);
>              }
>              throw e;
Index: src/templates/om/ObjectWithManager.vm
===================================================================
RCS file: 
/home/cvspublic/jakarta-turbine-torque/src/templates/om/ObjectWithManager.vm,v
retrieving revision 1.11
diff -r1.11 ObjectWithManager.vm
825c825,832
<             BasePeer.rollBackTransaction(con);
---
>             try
>             {
>                 BasePeer.rollBackTransaction(con);
>              }
>              catch (Exception rollBackEx)
>              {
>                  // Ignore because we've already got an exception
>              }
Index: src/templates/om/Object.vm
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/src/templates/om/Object.vm,v
retrieving revision 1.33
diff -r1.33 Object.vm
821c821,828
<             BasePeer.rollBackTransaction(con);
---
>             try
>             {
>                 BasePeer.rollBackTransaction(con);
>              }
>              catch (Exception rollBackEx)
>              {
>                  // Ignore because we've already got an exception
>              }

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

Reply via email to