Hi, you have to use o.save(con) instead of o.save() otherwise your transaction will not be used...
-----Original Message----- From: toto [mailto:[EMAIL PROTECTED] Sent: Sunday, January 25, 2004 3:08 PM To: [EMAIL PROTECTED] Subject: transactions 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08.01.2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08.01.2004 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
