Re: rolling back transactions with MS SQL Server?



On Feb 20, 10:42 am, "ddog" <wgblack...@xxxxxxxxx> wrote:
I'm unable to roll back transactions using MS SQL Server. I'm
connecting to the database with the following parameters:

jdbc:microsoft:sqlserver://
GX520-4HSMFC1:1433;databaseName=RECON;SelectMethod=cursor

The code that creates the connection is:
connection = connManager.get(Thread.currentThread().getName());

if(connection == null){
connection = createNewConnection();
connection.setAutoCommit(false);

}

When a connection is created and records are written, the following
statement fails to rollback the new records:
connection.rollback();

I have a feeling the problem lies in the SelectMethod=cursor setting.

Is there a way around this or am I missing something?

What is your transaction flow, and where/when do you commit? Does
a single given thread always begin and complete a transaction
before doing any other work for any other transaction? Otherwise,
a thread may do work for multiple 'transactions' but because it
is using only one connection for all these, it may commit more
than it intends to when it commits.

Joe Weinstein at BEA Systems

.