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

Mads Bondo Dydensborg mbd at dbc.dk
Fri Sep 21 01:25:14 EDT 2007


mandag 03 September 2007 skrev Mads Bondo Dydensborg:
Hi again.

I still can not resolve this question. But I did discover, that there is no 
public way to change the autocommit mode through the mono stack, meaning, 
that if one uses a transaction, one can never return to autocommit mode.

Is this really the right way to do things?

Regards

Mads


> 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
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 



-- 
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