db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aury G. Friedman" <tor...@fastestdog.com>
Subject Exception in BaseXxxx.save() leaves alreadyInSave=true
Date Tue, 17 Jun 2003 12:50:20 GMT
Hello. When I call xxxx.save()  and there is a SQL exception in its
BaseXxxx.save(), Torque does not set the alreadyInSave flag to false. It
rolls back the transaction and rethrows an exception, which is cool. But
since the flag is not reset, it will never again attempt to save the record.

Because the flag is private, the calling class itself can not alter the
flag. So I am left with altering the method in the base class to look like:
    public void save(String dbName) throws TorqueException
        Connection con = null;
            con = Transaction.begin(dbName);
        catch(TorqueException e)
            alreadyInSave=false; // added to prevent Torque from never
attempting to save the record
            throw e;

Am I missing something or is this a bug in Torque?
Aury G. Friedman

View raw message