[Mono-dev] More ODBC questions: AutoCommit and BeginTransaction

Mads Bondo Dydensborg mbd at dbc.dk
Mon Sep 3 08:40:57 EDT 2007


Hi all

I am not posting a bug, because I have no idea if this is a bug. Perhaps this 
is the intended way:

For ODBC connections, the default mode is "autocommit": Each statement is 
followed by an commit, done by the driver, client side. This can be disabled 
programmatically.

When an ODBC transaction is created in mono, we change the attributes in 
OdbcTransaction.cs:

     51                 internal OdbcTransaction(OdbcConnection conn, 
IsolationLevel isolationlevel)
     52                 {
     53                         // Set Auto-commit (102) to false
     54                         OdbcReturn 
ret=libodbc.SQLSetConnectAttr(conn.hDbc, OdbcConnectionAttribute.AutoCommit, 
IntPtr.Zero, 0);

We have to do that, obviously, but my question is wheter mono should 
reestablish the state of autocommit upon completion of the transaction? 
Currently it does not, but is this to be expected? I think, from my reading 
that it is, but would very much like a confirmation.

Currently I am not able to check out the behavoiur using MS .NET.

Thanks,

Regards

Mads

-- 
Med venlig hilsen/Regards

Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77 34




More information about the Mono-devel-list mailing list