Subject | Re: [Firebird-Java] How to rollback / autocommit off and on? |
---|---|
Author | Rick Fincher |
Post date | 2003-10-17T21:15:36Z |
Hi David,
Rather than turning autocommit back on just use the commit and rollback
methods of the connection as in: myConnection.commit() or
myConnection.rollback(). That should be much more efficient.
Rick
Rather than turning autocommit back on just use the commit and rollback
methods of the connection as in: myConnection.commit() or
myConnection.rollback(). That should be much more efficient.
Rick
----- Original Message -----
>
> 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