db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hassan Abolhassani <Hassan.Abolhass...@xist-i.co.jp>
Subject Transaction processing
Date Wed, 25 Feb 2004 07:33:25 GMT
Hi,

I have a code like below to update several tables in one transaction:

Connection con;
try{
    con = Torque.getConnection();
    Agency agency = new Agency(); 
    ...
    agency.save(con);
    ...

    Product product = new Product(); 
    ...
    product.save(con);


} catch (Exception e) {
   con.rollback();
} 
finally {
    if (null != con) {
        try {
            Torque.closeConnection(con);
        } catch (Exception exp) {}
    }
}


When an exception occures inside the main block, the rollback() is not
working. I mean some save operations updates database anyways.

I am using postgress. Could anybody tell me how it might work?

Regards,
Hassan

___

xist-i Japan, Inc.

アボルハッサニ ハッサン   Dr. Hassan Abolhassani  [Technology network]
株式会社 レーザーフィッシュ・ジャパン
Hassan.Abolhassani@razorfish.co.jp
Tel:03-5436-9980 Fax:03-5436-9126


---------------------------------------------------------------------
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