B4J Question How to use the xaemulation of the config.properties?

Aries Abedes

Member
Licensed User
Hi,

I am using the jRDC as a middleware between my android app and mssql server. I have created a linked server between the sql2000 and sql2008 so that i can do crud between the two servers. I have tested my stored proc and it is working well between servers using servername.dbname.dbo.tablename, but if i call it through my android app i got these error:
B4X:
ResponseError. Reason: java.sql.SQLException: The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction., Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /rdc. Reason:
<pre>    java.sql.SQLException: The operation could not be performed because the OLE DB provider &apos;SQLOLEDB&apos; was unable to begin a distributed transaction.</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.z-SNAPSHOT</a><hr/>
</body>
</html>

I thought it was an MSDTC error but reading this http://jtds.sourceforge.net/faq.html , xaemulation is possible although it is experimental but i'd like to give it a try. My question is how can i add it to the Sub Initialize of RDCConnector Class Module?

Thank you.

Aries
 

Aries Abedes

Member
Licensed User
My solution was to create two jRDC server on the same machine with different port and declare two DBRequestManager variables on my activity. I don't know if it is the right way to do it but it works as expected.

Thank you.

Aries

B4X:
Sub SpUpdateTblPOD 'SQL 2000 SERVER
   
    Dim cmd As DBCommand
    cmd.Initialize
    cmd.Name = "update_tblpod"
    cmd.Parameters = Array As Object(intPodID, strReceivedBy, strReceivedDate)
    reqManager.ExecuteCommand(cmd, "UpdateTblPOD")
End Sub

Sub SpUpdateTblRDPOD 'SQL2008 SERVER
       
    Dim cmd As DBCommand
    cmd.Initialize
    cmd.Name = "update_tblrdpod"
    cmd.Parameters = Array As Object(intPodID, strReceivedBy, strReceivedDate)
    reqManager2.ExecuteCommand(cmd, "UpdateTblRDPOD")
End Sub
 
Upvote 0
Top