Hi everyone,
so after having lots of issues with transactions not working for me, I
noticed this.
The rollback() method in Transaction class in org.apache.torque.util
package is setting AutoCommit to true after calling rollback on the
Connection object.
And then in the finally block the connection is being closed.
The code is reproduced here
public static void rollback(Connection con) throws TorqueException
{
if (con == null)
{
throw new NullPointerException(
"Connection object was null. "
+ "This could be due to a misconfiguration of the "
+ "DataSourceFactory. Check the logs and
Torque.properties "
+ "to better determine the cause.");
}
try
{
if (con.getMetaData().supportsTransactions()
&& con.getAutoCommit() == false)
{
con.rollback();
con.setAutoCommit(true);
}
}
catch (SQLException e)
{
category.error(
"An attempt was made to rollback a transaction "
+ "but the database did not allow the operation to be "
+ "rolled back.",
e);
throw new TorqueException(e);
}
finally
{
Torque.closeConnection(con);
}
}
The con.setAutoCommit(true); call seems unnecessary to me since the
connection is being actually closed in the Torque.closeConnection call.
So I commented out the con.setAutoCommit call and now when I do a rollback
and kill my app server(jboss) after that ,everything works fine.(Previously
killing my app server was resulting in database update even after a
rollback call had been executed)
Could this be a problem with the oracle jdbc driver??
thanks for help
-T
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>