Seeing changes in a transaction

Hi all,

I have a problem that I don’t know how to solve. I have 2 wrapper java classes to access 2 Natural modules. I have coded a driver java class to call this 2 wrappers in the same transaction. The first call creates a record (parent) and the second one creates another record that it’s attached to the first one (child).

Well, the problem is that the second call can’t see the record created in the first call.

Can anybody help me?

TIA

In fact, I have discovered that although I send a “closeConversationCommit” to the wrapper class, the transaction is not committed in Natural.

I assume that we don´t need the END-TRANSACTIONS in the Natural modules. Is this right?.

TIA
Felipe

  1. If a record has been added to Adabas, it is immediately available for read, even if not committed with an END TRANSACTION. Thus, if your second call is not seeing the record, something else is going on (e.g. backed out already or descriptor fields for selection not filled in). Can you see the record from Natural after the first call?

  2. Are you using a Broker (RPC) Conversation? You must maintain the conversation context in your client application or the conversation will be implicitly backed out. See the documentation for a discussion of Conversations - http://techcommunity.softwareag.com/ecosystem/documentation/crossvision/eli/javaWrapper/javaWrapper_writeAppsAdv.htm#Using_Conversational_RPC
    in particular:

Thanks Douglas for your reply.

This is my code:

String DEFAULT_BROKERID = "xxx.xxx.xxx.xxx:1971";
String DEFAULT_SERVER = "RPC/SWEBLD/CALLNAT";
String bUser = "USER";
Broker broker = new Broker(DEFAULT_BROKERID, bUser);
svc=new BrokerService(broker, DEFAULT_SERVER);
srmn2000 = new Srmn2000(svc); 
conv = new Conversation(srmn2000);
srmn2000.srmn2000(fillInHeader(request), input);
srmn2000.closeConversationCommit();

where input is the area parameter and srmn2000 is the wrapper class.

With this code and without END-TRANSACTION in Natural, the record is never committed. Is there any parameter to control this behaviour?

What am I doing wrong?.

Cheers
Felipe

Hi Felipe,
Not that I’ve experimented much with this myself, but I stumbled across this in the manual and it appears that the parm you are looking for could be ETEOP=ON.
Finn

Conversational CALLNAT

Execute an explicit END TRANSACTION on the server before the conversation is terminated by the client

Set the Natural profile parameter ETEOP to ON. This results in an implicit END TRANSACTION at the end of each conversation.

Before executing the CLOSE CONVERSATION statement, call the application programming interface USR2032N on the client side. This will cause an implicit END TRANSACTION at the end of the individual conversation.

You are missing a line of code:

String DEFAULT_BROKERID = "xxx.xxx.xxx.xxx:1971"; 
String DEFAULT_SERVER = "RPC/SWEBLD/CALLNAT"; 
String bUser = "USER"; 
Broker broker = new Broker(DEFAULT_BROKERID, bUser); 
svc=new BrokerService(broker, DEFAULT_SERVER); 
srmn2000 = new Srmn2000(svc); 
conv = new Conversation(srmn2000); 
/* missing "setConversation" */
srmn2000.setConversation(conv);
/* */
srmn2000.srmn2000(fillInHeader(request), input); srmn2000.closeConversationCommit();

Because your call is not actually in a conversation, an implicit BACKOUT TRANSACTION is likely being done. If the record is not in the database after the first call is executed (check from a Natural program in that environment), then it is this is likely the issue.