Subject RES: [Firebird-Java] How to rollback / autocommit off and on?
Author Francisco Vieira
try{
    con.setAutoCommit(false);
    try{
            ... your stuffs here....
            bla bla
            bla bla
        }
        con.commit();
        catch (SQLException se)
        {
            con.rollback();
        }
{
catch (Exception e1)
{
}
-----Mensagem original-----
De: dhay@... [mailto:dhay@...]
Enviada em: sexta-feira, 17 de outubro de 2003 15:31
Para: Firebird-Java@yahoogroups.com
Assunto: [Firebird-Java] How to rollback / autocommit off and on?


Hi,

I'm setting autocommit off, executing some code, and then if everything
goes okay, turning autocommit on again before returning the connection to
the pool, to commit everything.  So far, so good.

My question is what to do if something goes wrong, and I want to rollback
the changes made.  As I am using connection pooling I have to set the
autocommit on again, but what's the best way to roll back the changes
before I do so?

Many thanks,

David





To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.