cancel
Showing results for 
Search instead for 
Did you mean: 

Using 2 Jco's in a project.

Former Member
0 Kudos

Hi Gurus,

I have an application where in we have 2 different Jco's A and B to execute 2 different BAPI's C and D respectively(This approach had to be used for an upgradation project). After i execute BAPI C with A, i try to release the JCo client A and hence keeping B to execute D. When i try to do this there is an error reding - " com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: A client allocated from pool D_useDefinedUser cannot be disconnected directly. Please, use JCO.releaseClient(JCO.Client) instead. " Please Help.

Thank You.

Kind Regards,

Manoj Durairaj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi!

you can see some trouble shooting guides in adaptive rfc

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f3f93ee7-0c01-0010-2593-d7c28b53...

regards

vishal

Former Member
0 Kudos

Hi Vishal,

Thanks for the document. However i couldnt find a solution for my error.

Thank You.

Kind Regards,

Manoj Durairaj

Answers (3)

Answers (3)

lokesh_kamana
Active Contributor
0 Kudos

Hi,

It will be active untill the time in the connection time out specified is over after that the connection will be returned to the pool for processing the next request.

Thanks & Regards,

Lokesh

lokesh_kamana
Active Contributor
0 Kudos

Hi,

When we create the JCO Destinations we have an optio called connection timeout.

Upto that time the JCO destination will noyt be used.

Go through the below document which will be very much helpfull to you.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/705f2b2e-e77d-2b10-de8a-95f37f4c...

Thanks & Regards,

Lokesh

lokesh_kamana
Active Contributor
0 Kudos

Hi,

There are 2 cases with

1.If you getting the connection from a pool

f you are using JCo connection yourself explicitly (i.e. gte them from pool yourself), then you must call JCO.releaseClient(jcoClient)

2.If you are using Default JCO connection.

If you are using JCo connection implicitly via Adaptive RFC Model, then you should not close it yourself, but rather call disconnectIfAlive on model.

For open connections, by default your models are set to Application scope and because of this it will retain connections. If you want to close this connections you have to write following one line code after executing your model.

wdcontext.current<node name>element().modelObject().modelInstance().disconnectIfAlive();

it will close your connection to the SAP R/3.

I think urs is the 1st case.

Try releasing the clients.

Thanks & Regards,

Lokesh

Former Member
0 Kudos

Hi Lokesh,

Thanks for this wonderful answer. However, the problem is solved. We changed the JCo properties while creating from logon ticket to user id/password. We then created the JCo programatically and then setting it to the other model classes. That solved the issue. However i need a clarification, is it that when i go onto execute a BAPI, the JCo connection that was used to execute will die automatically or will it be active.

Thank You.

Kind Regards,

Manoj Durairaj

Former Member
0 Kudos

Manoj,

you can manually kill the connections(model)

check this thread

Thanks

Bala Duvvuri