I've been trying to use TransactionScope with a DB2 database (using DB2 .Net provider v 9.0.0.2 and c# 2.0) which SHOULD be supported according to IBM.
I have tried all the advice i could find on the IBM forums (such as here) to no avail.
I have enabled XA transactions on my XP Sp2 machine, tried also from a Win 2003 Server machine but i consistently get the infamous error:
ERROR [58005] [IBM][DB2/NT] SQL0998N Error occurred during
transaction or heuristic processing.
Reason Code = "16". Subcode =
"2-80004005". SQLSTATE=58005
The windows event log says:
The XA Transaction Manager attempted to load the XA resource
manager DLL. The call to LOADLIBRARY
for the XA resource manager DLL
failed:
DLL=C:\APPS\IBM\DB2v95fp2\SQLLIB\BIN\DB2APP.DLL
File=d:\comxp_sp2\com\com1x\dtc\dtc\xatm\src\xarmconn.cpp
Line=2467.
Also, granted the NETWORK SERVICE user full rights to the folder and dll.
Here's the MSDTC startup message
MS DTC started with the following
settings:
Security Configuration (OFF = 0 and
ON = 1):
Network Administration of Transactions = 0,
Network Clients = 0,
Inbound Distributed Transactions using Native MSDTC Protocol = 0,
Outbound Distributed Transactions using Native MSDTC
Protocol = 0,
Transaction Internet Protocol (TIP) = 0,
XA Transactions = 1
Any help would be much appreciated!
Thanks,
Florin
I managed to get the creaky old IBM DB2 v7 ODBC driver working in a TransactionScope. It required:
XA transactions enabled in MSDTC properties
A value entered under the registry key HKLM\SOFTWARE\Microsoft\MSDTC\XADLL with name 'DB2CLI.DLL' and value 'C:\PROGRA~1\IBM\SQLLIB\BIN\DB2CLI.DLL' (path to dll in 8.3 format - v9 uses DB2APP.DLL)
A reboot
Not closing the connection prior to the TransactionScope being disposed. It seems obvious in retrospect. :)
I'm not sure if this is relevant to your particular scenario. The IBM documentation shows reason code 16, subcode 2 as "The MSDTC is unable to register the DB2 connection." There appears to be some issue with MSDTC finding the DB2 dll - perhaps check the registry key referenced above?
I solved this issue by activating MS DTC as in the image below:
run dcomcnfg;
Component Services > Computers > My Computer > Distributed Transaction Coordinator
Select Local DTC > Properties > Security Tab:
Reboot your machine and try again. Make sure you have the latest IBM Drivers. I tested with 10.1 Fix Pack 1 and Informix 11.50.
Source: http://blogs.msdn.com/b/bill/archive/2006/12/12/using-msdtc-between-vista-clients-and-windows-2000-servers.aspx
Related
I'm trying to connect to Db2 but I get the following error message
[jcc][t4][2034][11148][4.25.23] Execution failed due to a distribution protocol error that caused deallocation of the conversation.
A DRDA Data Stream Syntax Error was detected. Reason: 0x3. ERRORCODE=-4499, SQLSTATE=58009
What does that mean, and how do I get connected?
Well the short answer is that you might just need to add the sslConnection=true JDBC parameter
I.e. your JDBC URL needs to look something like this
db2://db2whoc-abcdefg.services.eu-de.bluemix.net:50001/BLUDB:sslConnection=true;
Depending on what tool you are using, you might edit the URL directly, or add as an extra JDBC property
Now the above only works if you are using a reasonably recent JDBC driver.
The DigiCertGlobalRootCA.crt used by e.g. Db2 on Cloud, Db2 Warehouse and Db2 Warehouse on Cloud was not bundled in older drivers. You can cross-reference the driver version (e.g. 4.25.23 in the question) against the drivers listed here. DB2 JDBC Driver Versions and Downloads and upgrade if not on the latest release
If your Db2 server is using a different certificate (for example a self-signed certificate) then you would need to download the certificate, and set the JDBC property sslCertLocation to point to it's location, or you can import the certificate into a local store, and use sslTrustStoreLocation and sslTrustStorePassword and a import the cert into their local certificate store.
All these JDBC properties are described on the
Common IBM Data Server Driver for JDBC and SQLJ properties for all supported database products page
Environment:
IBM Worklight 6.2,
IBM Liberty 8.5.5.1,
IBM DB2 10.5 &
Windows 2008 standard Edition.
For the High Availability of DB instance[WLDBINST], the following Architecture I have followed.
2 Windows Clustered Machines with IBM DB2 binary and SAN storage used to share the Database file in Common.
If any 1 node is not available the other node will take over the control without any loss of the data.
I have tested the DB2 instance via Cluster IP and it works fine.
The below error has been logged, when I run the Worklight Server Configuration tool,
Instance WLDBINST not found on server. Found only [WLDBINST C, :, DB2CLUSTER, DB2]
I have found the reason for the above issue. To list the DB2 Instances we can use the command db2ilist
C:\>db2ilist
WLDBINST C : DB2CLUSTER
DB2
Above result shows that we have two instances
WLDBINST which is in "C" drive and part of DB2CLUSTER &
DB2
Worklight Configuration tool also uses the similar DB2 tool to list the instances, I guess.
So the configuration tool considering the result as 4 instances as follows,
WLDBINST C,
:,
DB2CLUSTER and
DB2
How I can resolve this issue.
If the Server Configuration Tool is not able to create the database for your topology, you should create it manually before running the tool.
For the Administration database, the doc is here:
https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/admin/t_creating_the_db2_database_for_wladmin.html
For the Project Runtime databases, the doc is here:
https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.deploy.doc/admin/t_creating_the_db2_databases.html
The server configuration tool will not do any specific configuration to ensure that Liberty reopens a connection if there is a database node switch. I recommend that you review the behavior of Liberty in this case, and add settings in the server.xml as required.
It seems I am running into the Microsoft Distributed Transaction Coordinator (MSDTC) related issue.
SCENARIO
I am using TransactionScope and with in the single scope it hits two different databases on different servers (for instance, DB_A running Windows Server 2003 and DB_B running Windows Server 2008). One database is accessed using Entity Framework 4.0 and another using normal ADO.NET APIs.
When I run the application from my development machine (running WinXP) it commits and rollbacks both the connections accurately. But when I run the application, deployed on another server (for instance WAS_A running Windows Server 2003) it commits correctly but in case of exception is doesn't roll back the database activities on both the servers.
I thought it would be the MSDTC configuration issue on the WAS_A. So I went to the MSDTC -> Security Configuration and checked all the available options (as I did previously on other machines). But still I am facing the same issue.
Looking for your expert advices. :)
I believe that you need to look into Enabling Transaction Flow. Specifically, take a look at how one may error and the other complete as described in TransactionScope and WCF Services:
an error in a second WCF service call was NOT rolling back the changes made in a previous WCF service call...
In order to create an ambient transaction in your client and ensure that it is used by your WCF services...
The article then details the following steps:
Configure Your Binding with transactionFlow
Decorate Your Interface with [TransactionFlow(TransactionFlowOption)]
Decorate Your Method with [OperationBehavior(TransactionScopeRequired)]
Optionally update your Connection Strings with Transaction Binding*
*Note: This is optional in my opinion.
We have an application server with the following spec’s:
• Windows 2008 R2 operating system.
• All prerequisites are configures successfully and correctly: Windows roles, MSDTC and connection to SQL DB server.
• MS Reporting Services 2008 R2 are installed and configured successfully, and all reports are deployed and render with no problems.
The application server connects to SQL Server 2008 R2 DB on different server - there are no firewalls between the 2 servers , and using UDL file, the connection is always successful using windows authentication or SQL authentication on SQL Server.
When we install “K2 blackpearl 4.5 (4.10060.1.0) with Update KB001040”, the setup completes successfully but the following exception appears when we open work list, when K2 setup manager is opened for reconfiguration and when rendering any report on the report manager: “A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)” although all DB’s are created successfully during the installation for K2. Also all other features at K2 (any feature at Management Console) and Report Manager (deployment of reports, management of data sources, and folder/report settings) works perfectly.
When we remove K2 components from the server the reporting services works successfully again, without any reconfiguration.
We tried to move the server to new environment to check if there is a problem with the server itself, all installation and configuration are completed with no problems and the error message disappeared.
We did check all of below points:
• MSDTC configuration.
• All ports are open between the 2 servers.
• SQL connection is always successful between the 2 servers.
• We have a third server with MOSS 2007 installed and it works perfectly with problems in connection to DB.
• All users used for windows services and SQL windows connection are active and configured correctly.
o Have SQL login with dbcreator and SecurityAdmin roles.
o Are added as Administrators on Application server.
• We have tries Windows authentication and SQL authentication and they all gave the same problem.
• We have used a newer version of K2 installation files “K2 blackpearl 4.5 (4.10060.1.0) with KB001320” and it failed at the last steps of installation with the same problem.
Please help on this.
(full disclosure i work for K2) and looked through our system as well as the support forum and could not find a reference to this error. From the people i talked to it appears to be a general network issue, with quite a few possible causes, including something as simple as the network card. Although I am not 100% clear on a few points you made. When you said
"following exception appears when we open work list" Where are you opening the worklist from?
When you said
"When we remove K2 components from the server the reporting services works successfully again, without any reconfiguration."
Are you getting this error in SQL Reporting Services?
You can also post a question in http://k2underground.com someone else may have seen this.
Edit I asked around and there does not seem to be any good answers to this at the moment. Would you be willing to open a K2 support ticket and let us look at the K2 logs or see the config via livemeeting? Thanks!
I am using SQL Server 2008 on Windows Server 2003. I want to use a linked server to open a Visual Foxpro DBF file, using driver Microsoft OLD DB Provider for Visual Foxpro from SQL Server 2008 linked server feature.
When I establish linked server connection by using Microsoft OLD DB Provider for Visual Foxpro, to open a Foxpro DBF file, I meet with the following error, any ideas what is wrong?
Can not retrieve required data from this request (Microsoft.SqlServer.Management.Sdk.Src)
Meeting exception when executing Transact-SQL or batch (Microsoft.SqlServer.ConnectionInfo)
Error from Microsoft OLD DB Provider interface "VFPOLEDB" of linked server "DBFServer", access is defined.
Can not retrieved required interface "IID_IDBSchemaRowset" from OLE DB interface "VFPOLEDB" of linked server "DBFServer"
(Microsoft SQL Server error 7399)
regards,
George
Check 'Allow Inprocess' on the VFPOLEDB provider:
See Cindy Winegarden's answer on http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/e54d20dd-b65b-4cff-9349-6499e6e069e2 for how to do it.
Edit: this is the relevant part of the answer:
Here's what Stepahnie posted to her thread in the
microsoft.public.data.oledb NNTP newsgroup on April 10:
"Finally, I found an option ' Allow inprocess' in linked server ->
providers -> VFPOLEDB in MSSQL2005. With enable this option, I can
connect to vfp with oledb. While diabling this option, it works only
50% with successful connection....
And I have another MSSQL2005 with the same setup (except the option
'allow inprocess' disabled), all the connection make to vfp is 100%
successful... "
I looked and found that, as she said, in Server Objects > Linked
Servers > Providers > VFPOLEDB > General tab > Provider options >
Allow inprocess. Also, you can change the InProcess setting with the
following code:
USE [master]
GO
EXEC master.dbo.sp_MSset_oledb_prop N'VFPOLEDB', N'AllowInProcess', 1
GO