cancel
Showing results for 
Search instead for 
Did you mean: 

Close jco connection

Former Member
0 Kudos

Hi

Can anyone tell me how to retrieve the existing jco connection and close it. Can we write that code in wdExit.

Thanks

Vidyadhar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

Thanks for your reply. My problem is that on every refresh of the page I want to close the old connection explicitly and I will create a new connection. So what should I write in init to close the old connection?

Former Member
0 Kudos

Hi,

Create a method say disconnect and put the code as postyed by me, and call that method in wdDoInit.

Former Member
0 Kudos

Hi

I posted your code in init, but it doesn't work for me.

Former Member
0 Kudos

Hi,

Did you mean closing "old connection explicitly", the data associated with as well,

then for that you need to invalidate all nodes associated so that all old data will be cleared.

Former Member
0 Kudos

Hi

Can you please tell me if JCO.releaseClient() works for this?

Former Member
0 Kudos

Hi vidyadhar,

try this code

wdContext.currentBAPIElement().modelObject().modelInstance().disconnectIfAlive();

and u dont want to write that code in WDEXIT.

with regards,

sriram

Former Member
0 Kudos

Hi,

Following code can be used

AAAAModel thisModel =

(AAAAModel) WDModelFactory.getModelInstance(

AAAAModel.class);

thisModel.disconnectIfAlive();

You can call this code's method in wdDoExit()