VB 2005 trying to use TransactionScope with DB2 backend

G

Guest

***Environment***
Visual Basic 2005
..Net Framework 2.0

DB2 Direct Connect Client info as follows
DB2Level -> "DB2 v7.1.0.40" (This is the Client level driver)
Running on XP Pro, SP2

***Problem***
Trying to wrap an Update Statement in a Transaction and get the following
error.

ERROR [58004] [IBM][CLI Driver] CLI0119E Unexpected system failure.
SQLSTATE=58004

If I comment out lines 3 and 9 (Using Scope) the routine works fine.

(The UpdateAGN is a simple Update of a counter + 1)


1 Try
2
3 Using scope As New TransactionScope
4
5 LastAGN = GetLastAGN_ID(TableName, ColName)
6
7 Call UpdateAGN(LastAGN + 1, TableName, ColName)
8
9 End Using
10
11 Return LastAGN + 1
12
13
14 Catch ex As Exception
15
16
17 Throw
18
19 End Try
 
F

Frans Bouma [C# MVP]

Memphis said:
Environment
Visual Basic 2005
.Net Framework 2.0

DB2 Direct Connect Client info as follows
DB2Level -> "DB2 v7.1.0.40" (This is the Client level driver)
Running on XP Pro, SP2

***Problem***
Trying to wrap an Update Statement in a Transaction and get the
following error.

ERROR [58004] [IBM][CLI Driver] CLI0119E Unexpected system failure.
SQLSTATE=58004

If I comment out lines 3 and 9 (Using Scope) the routine works fine.

(The UpdateAGN is a simple Update of a counter + 1)


1 Try
2
3 Using scope As New TransactionScope
4
5 LastAGN = GetLastAGN_ID(TableName, ColName)
6
7 Call UpdateAGN(LastAGN + 1, TableName, ColName)
8
9 End Using
10
11 Return LastAGN + 1
12
13
14 Catch ex As Exception
15
16
17 Throw
18
19 End Try

DB2 doesn't support lightweight transactions yet, so the transaction
you're creating is actually an enterprise services-using transaction,
i.e. a COM+ one. If DB2 isn't prepared for COM+/MTS, this won't work.

Tip: use a normal ADO.NET transaction.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top