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

A Nagappan anagappan at novell.com
Thu Sep 27 06:49:19 EDT 2007


Hi Amc / Mads,

Thanks for the patch. Fixed in revision 86473.

Thanks
Nagappan
-- 

--
Nagappan A <anagappan at novell.com>
Linux Desktop Testing Project - http://ldtp.freedesktop.org
http://nagappanal.blogspot.com

Novell, Inc.
SUSE* Linux Enterprise 10
Your Linux is ready*
http://www.novell.com/linux




>>> On 9/24/2007 at 4:16 PM, in message
<200709241246.49330.mbd at dbc.dk>, Mads Bondo
Dydensborg <mbd at dbc.dk> wrote:
> fredag 21 September 2007 skrev Amc Gmail:
>> Hi, Mads,
>> 
>> it seems to be you are right and i am also getting ugly transaction
>> state errors from db2 odbc with mono. i wrote quick dirty patch :)
to
>> fix OdbcTransaction.cs and it would be great if you can try it
(diff
>> and svn diff attached, use any for your convenience). unfortunately
i
>> can't even compile it before mid-october and so sorry (in advance)
if
>> that code has any bugs.
> 
> Hi Amc.
> 
> I just tried your patch, and it works very nicely. There was a small
problem 
> 
> in getting it to compile, because your patch actually exposes a bug,
IMHO, 
> in 
> the existing codebase. Please find attached a patch against current
svn.
> 
> To the ODBC maintainer: Please review this patch for inclusion in
mono. I 
> believe it solves two things:
> - setting autocommit back to on (default for ODBC), when leaving a 
> transaction
> - actually throws, if the isolationlevel of a transaction can not be
set 
> through the odbc driver.
> 
> Regards,
> 
> Mads
> 
> 
>> 
>> i hope it would help :)
>> -- amc
>> 
>> 
>> On 9/21/07, Mads Bondo Dydensborg <mbd at dbc.dk> wrote:
>> > 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
>> >
>> > _______________________________________________
>> > Mono-devel-list mailing list
>> > Mono-devel-list at lists.ximian.com 
>> > http://lists.ximian.com/mailman/listinfo/mono-devel-list 
>> >
>> 
> 
> 



More information about the Mono-devel-list mailing list