Topic
1 reply Latest Post - ‏2012-11-08T10:50:05Z by SystemAdmin
SystemAdmin
SystemAdmin
17917 Posts
ACCEPTED ANSWER

Pinned topic .NET DB2 Data Provider 9.7.5

‏2012-04-11T10:01:37Z |
Hi,

I'm using DB2 Server Client Package v9.7 fix 5, and have a problem when trying to retreive data from database from Microsoft Lightswitch application in VisualStudio 2010.
The OS on the client machine is Windows 7 64-bit.

The error message I have here is:

InnerException = {"ERROR 58005 IBMDB2/NT SQL0998N Error occurred during transaction or heuristic processing. Reason Code = \"16\". Subcode = \"2-80004005\"."}

I saw a lot of posts in this forum that are related with this error code and subcode, tried all the recomended solutions, but no luck.

The strange thing is that provider with the same connection string works from a simple Windows Forms application.

From the previous posts that I've read I understood that this error code has something to do with XA transactions, so I ran testconn20 and testconn40 with -dtc options, and here's the response:

adding MSDTC step

Step 1: Printing version info
.NET Framework version: 2.0.50727.5448
64-bit
DB2 .NET provider version: 9.0.0.2
DB2 .NET file version: 9.7.5.2
Capability bits: ALLDEFINED
Build: 20111018
Factory for invariant name IBM.Data.DB2 verified
Factory for invariant name IBM.Data.Informix verified
IBM.Data.Informix from DbFactory is the Common Informix .NET provider
Elapsed: 4.5233217

Step 2: Validating db2dsdriver.cfg against db2dsdriver.xsd schema file
C:\ProgramData\IBM\DB2\DB2COPY1\cfg\db2dsdriver.cfg against C:\Program F
iles\IBM\SQLLIB\cfg\db2dsdriver.xsd
Elapsed: 0.2421813

Step 3: Connecting using "Database=RZTRDB;User ID=db2admin; Password = nenasm; S
erver=10.0.1.25;Persist Security Info=True"
Server type and version: DB2/NT 09.07.0003
Elapsed: 1.6952691

Step 4: Selecting rows from SYSIBM.SYSTABLES to validate existence of packages
SELECT * FROM SYSIBM.SYSTABLES FETCH FIRST 5 rows only
Elapsed: 0.4999872

Step 5: Calling GetSchema for tables to validate existence of schema functions
Elapsed: 0.8671653

Step 6: Creating XA connection
DB2TransactionScope: Failed to open connection to database!
IBM.Data.DB2.DB2Exception: ERROR 58005 IBMDB2/NT SQL0998N Error occurred
during transaction or heuristic processing. Reason Code = "16". Subcode = "2-FF
FFFFFF80004005".
at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnecti
onString, DB2ConnSettings& ppSettings, Object& ppConn)
at IBM.Data.DB2.DB2Connection.Open()
at TestConn.DB2TransactionScope.Open(String connstr)

Looking for XADLL key for C:\Program Files\IBM\SQLLIB\bin\db2app.dll
Incorrect registry entry for C:\Program Files\IBM\SQLLIB\bin\db2app.dll
in SOFTWARE\Microsoft\MSDTC\XADLL
is: C:\Program Files\IBM\SQLLIB\bin\db2app64.dll, should be C:\Progra
m Files\IBM\SQLLIB\bin\db2app.dll
Test failed.

I've also tried running the 32 bit versions, and response is (steps 1 through 5 are the same as previous):


Step 6: Creating XA connection
DB2TransactionScope: Failed to open connection to database!
IBM.Data.DB2.DB2Exception: ERROR 58005 IBMDB2/NT SQL0998N Error occurred
during transaction or heuristic processing. Reason Code = "16". Subcode = "2-80
004005".
at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnecti
onString, DB2ConnSettings& ppSettings, Object& ppConn)
at IBM.Data.DB2.DB2Connection.Open()
at TestConn.DB2TransactionScope.Open(String connstr)

Looking for XADLL key for C:\Program Files\IBM\SQLLIB\bin\db2app.dll
Missing registry entry for C:\Program Files\IBM\SQLLIB\bin\db2app.dll in
SOFTWARE\Microsoft\MSDTC\XADLL
Test failed.


..here it says that the value for key "C:\Program Files\IBM\SQLLIB\bin\db2app.dll" is missing, even it is in the registry!?
So, both values in registry point to db2app64.dll (it is like that after the installation of package 9.7. fix 5).
I've tried to change them value of key 'C:\Program Files\IBM\SQLLIB\bin\db2app.dll' to point to db2app.dll, and then got a different respose in step 6 for testconn20:

Step 6: Creating XA connection
DB2TransactionScope: Failed to open connection to database!
IBM.Data.DB2.DB2Exception: ERROR 58005 IBMDB2/NT SQL0998N Error occurred
during transaction or heuristic processing. Reason Code = "16". Subcode = "2-FF
FFFFFF80004005".
at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnecti
onString, DB2ConnSettings& ppSettings, Object& ppConn)
at IBM.Data.DB2.DB2Connection.Open()
at TestConn.DB2TransactionScope.Open(String connstr)

Looking for XADLL key for C:\Program Files\IBM\SQLLIB\bin\db2app.dll
Correct entry found
Check if XA Transactions are enabled:
Windows 7, 2008, Vista -
Component Services, Computers, My Computer,
Distributed Transaction Coordinator, Local DTC
Properties, Security tab, Enable XA Transactions
Other windows versions -
Component Services, Computers, My computer, Properties
MSDTC tab, Security configuration, Enable XA Transactions
Test failed.


Now, notice that here I ran the testconn20 which is supposed to be a 64bit version, but it is apparently looking for a value of the key "C:\Program Files\IBM\SQLLIB\bin\db2app.dll", which is, as I understand, a key for 32bit dll path...strange.

XA Transactions are enabled on the client machine.
Does anyone have a clue what can be the problem here?

Kind regards,

Vladimir
Updated on 2012-11-08T10:50:05Z at 2012-11-08T10:50:05Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    17917 Posts
    ACCEPTED ANSWER

    Re: .NET DB2 Data Provider 9.7.5

    ‏2012-11-08T10:50:05Z  in response to SystemAdmin
    Hi Vladimir,

    I'm evaluating Lightswitch and want to test whether I can get a connection to Informix V11.5.
    I installed IBM.Data.DB2 + Informix and succeeded in testconn40.exe.
    I also could connect to the database from Microsoft Visual Studio V2010 by
    create Entity Data Modells reading the scheme from the database.

    But reading a datasource from lightswitch did not work.
    I added a datasource to that database - test connection worked.
    But before the next step (where the tables should be shown), I got an error
    message (in German):
    Fehler beim Ausführen der Befehlsdefinition. Weitere Informationen finden
    Sie in der internen Ausnahme.
    ERROR IX000 IBMIDS/UNIX32 Internal error in routine opjoin().
    in English like: Error on executing command definition. More information in
    internal exception.
    ERROR IX000 IBMIDS/UNIX32 Internal error in routine opjoin().

    I could not find any hints on that.

    Did you succeed in connecting Informix to Lightswitch?
    Is it worth to go on?

    I found some hint to develop with MS-SQL Express and then switch to
    Informix connection string in deployment. But I couldn't find the right
    connection string yet (with the right provider)...

    Perhaps, you can give me some hints.

    Kind regards

    Alfred