Dear All,
I have a VB6.COM program using a VB6.COM DLL, which in turn uses ADODB that
performs various bits of SQL.
I have re-written the VB6.COM DLL in C#.NET (with a VB6 shell), which uses
the ADODB.Interop library supplied with .NET. The VB6.COM program above
calls this C#.NET library in an effort to perform the equivalent
functionality.
However, when I look at the trace information in the SQL Server Profiler,
they behave annoyingly differently.
In COM-COM-ADODB, BeginTrans causes a SET TRANSACTION ISOLATION LEVEL
REPEATABLE READ to occur. From that point on, no change to TRANSACTION
ISOLATION LEVEL is made.
In COM-.NET-Interop.ADODB, BeginTrans(Specification of RepeatableRead
argument is necessary here) causes SET TRANSACTION LEVEL REPEATABLE READ to
occur. CommitTrans causes a SET TRANSACITON LEVEL READ COMMITTED to occur.
So, to maintain TRANSACTION LEVEL REPEATABLE READ, the specific property
needs to be set on the connection object (which is not alway observed).
The question:
How can I, in .NET using Interop.ADODB, sometimes using ADODB connections
passed to it by COM programs, sometimes opening its own ADODB connections,
ensure/enforce that a connection's transaction isolation level is maintained
at the desired level, and that the system doesn't make decisions on my
behalf?
Eric