db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "netseeker" <netsee...@manskes.de>
Subject RE: transactions
Date Sun, 25 Jan 2004 20:30:07 GMT
Hi,

you have to use o.save(con) instead of o.save() otherwise your transaction
will not be used...


-----Original Message-----
From: toto [mailto:enrico.maccias@free.fr]
Sent: Sunday, January 25, 2004 3:08 PM
To: torque-user@db.apache.org
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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

---
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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message