Home : J-Integra for COM : INFO : J-Integra and ADO Disconnected Recordsets
Q30947 - INFO: J-Integra and ADO Disconnected Recordsets

J-Integra and ADO Disconnected Recordsets

 

Contents

  1. SYMPTOMS
  2. CAUSE
  3. RESOLUTION

SYMPTOMS

Using disconnected Recordsets in DCOM mode is not supported by J-Integra's DCOM mode. For example, you may one of these error messages below.

  • java.lang.NullPointerException
  • AutomationException: 0x800a0e78 - Operation is not allowed when the object is closed. in 'ADODB.Recordset'

For instance, if you have a Java client accessing VB program, the VB functionGetConnectedRecordset() can be successfully invoked from Java but the VB function GetDisconnectedRecordset() will fail.

Public Function GetConnectedRecordset() As ADODB.Recordset
  Dim c As ADODB.Connection
  Set c = New Connection
  c.Open "driver=Microsoft Access Driver (*.mdb);dbq=C:\\pure\\products.mdb", , , -1
  Set GetRecordset = c.Execute("SELECT * FROM Products", , -1)
End Function

Public Function GetDisconnectedRecordset() As ADODB.Recordset
  Dim rs As New ADODB.Recordset
  rs.Open
  Set GetRecordset = rs
End Function

CAUSE

J-Integra does not support custom-marshalled objects (object references that are passed by value instead of by reference) in DCOM mode. Disconnected Recordsets require custom-marshalling and a special COM object to be loaded into the client to decode the recordset.

RESOLUTION

Disconnected Recordsets work fine in J-Integra's native mode. In Native mode, the J-Integra runtime interacts using standard COM calls, rather than talking the DCOM protocol from pure Java.

If the environment does not allow for native mode to be used, another option is to create a COM wrapper around the code that uses Recordsets. For example, you could create a Visual Basic COM component which uses disconnected Recordsets to retrieve data. Your Java application could then use J-Integra to access this VB COM component and get the data it requires.

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 6/23/2006.
Last Modified on 9/8/2009.
Last Modified by J-Integra KB Admin.
Article has been viewed 9185 times.
Rated 6 out of 10 based on 15 votes.
Print Article
Email Article