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

.



Relevant Pages

  • Re: SQLCE 3.0 losing data after transaction
    ... You can also control the flush scheduling time using Connection String ... only SqlCeResultSet to get data from the database. ... CommandType.Text) As SqlCeCommand ... If Transaction IsNot Nothing Then ...
    (microsoft.public.sqlserver.ce)
  • Re: Driver AutoCommit issue
    ... I am using the container managed transaction and I expect the container to handle that for me. ... Is there different driver class that i have to use in the connection pool configuration. ... Why I am saying the DML always gets committed is when I step thought the code I can see the updated data in the database immediately after the callable statement is executed Even before the EJB method that invoked the call is completed. ... I set the auto commit to false on connection as soon as I get the connection from the datasoruce. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Problem with SQLServerCE
    ... deployed and overwriting the new and updated database file on the device. ... SqlCeTransaction transaction = null; ... connection = GetConnection; ... SqlCeCommand command = new SqlCeCommand("SELECT id from ...
    (microsoft.public.sqlserver.ce)
  • Re: Connection types and speeds
    ... The memory used by holding the connection open is not ... All recordset inserts seen to consequently have 0ms execution time, ... actually written to the database while the code has regained control ... RecordsetClone of a form) when a transaction was rolled back, ...
    (microsoft.public.access.queries)
  • Re: psycopg, transactions and multiple cursors
    ... > first time a change is made to the database. ... My intention is actually to keep them in the same transaction. ... >> cursor fetches one record from the database at a time). ... > generated from the same connection, ...
    (comp.lang.python)