cancel
Showing results for 
Search instead for 
Did you mean: 

JCO calling error

Former Member
0 Kudos

Hi, experts:

I got a problem when calling a RFC from EJB by using JCO object.

Sometimes JCO return last calling result, and when i manual calling again. JCO return correct value.

How to reset connection?

Thanks for any hints.

Best regards,

Nick.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nick,

I'm assuming you're using JCo 2.x (and not 3.x where by default all connections are stateless). If you're using a connection pool, the connections should get reset when you return the connection to the pool via JCO.PoolManager.releaseClient(JCO.Client); otherwise you might need to call JCO.Client.reset() yourself.

Another possibility for odd results could be re-cycling of JCO.Function objects. It's usually best to create them fresh for each call, otherwise you'd have to ensure that the interface parameters are initialized properly.

Cheers, harald

Former Member
0 Kudos

Hi, Harald:

Thanks for your helpful response.

I add reset and release code in the bottom my ejb program.

I will watch program debug output to see this change is work or not.

Best regards,

Nick.

Former Member
0 Kudos

Hi, Harald:

Revised code works!!

But another situation happen that is sometimes JCO return empty result.

Could it be previous release action to made next time calling fail?

Best regards,

Nick.

Former Member
0 Kudos

<div style="text-align:left">But another situation happen that is sometimes JCO return empty result.

Could it be previous release action to made next time calling fail?</div>

Hard to comment without knowing details. Assuming that all your calls are made in a new context, the connection should be kind of stateless. However, in theory you could of course have an RFC function that behaves different over time or where it runs (application server), etc.; in practice though this is unlikely.

To better understand what's going on I'd recommend to activate tracing. You can set the trace level by passing the command line argument -Djco.trace_level=N (where N is between 0 and 10, 10 being most detailed trace) and -Djco.trace_path=<path> to your java executable (or however you want to accomplish that on your J2EE server).

In addition it might help to also activate tracing for the executed RFC calls by setting the environment variable RFC_TRACE=1 and if more details are required RFC_TRACE_DUMP=1.

Maybe there's some silly problem and the request parameters are different or not as expected...

Former Member
0 Kudos

Hi, Harald Boeing:

Thanks for your reply, the issue has been resolved.

Best regards,

Nick.

Answers (0)