db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toto <enrico.macc...@free.fr>
Subject transactions
Date Sun, 25 Jan 2004 14:08:29 GMT
Hi,

 I'm trying to use transactions with torque but it does not seem to work...
here's roughtly what i wrote :

Connection con = null;
    try {
             con = Transaction.begin("mydb");
             o.setCredit(1000$);   // my torque data object
              ...  
              o.save();
              retval = callSomeChargeOperation(1000$, ...);
              if (retval < 0) Transaction.rollback(con);  
               else Transaction.commit(con);
    } catch (TorqueException te) {
            Transaction.rollback(con);
    }

The rollback does not work!
Changes have effectively been applied to the database when rollback() 
returns.
What's wrong? what should I write to make transactions work properly?

BTW, i'm running torque 3.0.2


thanks in advance,
enrico


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message