on 7/6/01 10:16 AM, "John McNally" <[EMAIL PROTECTED]> wrote:

> I think Leon is correct with his example, you do not want to rollback
> the transaction if no Exception is thrown.
> 
> john mcnally

Ahh...you are right...I missed that one...

Ok,

Then I would suggest writing it like this:

catch (Exception e)
{
BasePeer.rollbackTransaction(dbCon);
Log.error(e)
}

With the Log.error(e) *after* the rollback in case that Log.error(e) throws
an exception of some sort...

Or...even more safe...

catch (Exception e)
{
    try
    {
        Log.error(e)
    }
    finally
    {
        BasePeer.rollbackTransaction(dbCon);
    }
}

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


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

Reply via email to