cancel
Showing results for 
Search instead for 
Did you mean: 

jco exception

Former Member
0 Kudos

hi guys,

i am using jco program to connect sap via jco

using connection pooling program.....

there i get JCO_ERROR_COMMUNICATION

a pool with identifier 'pool' already exists it saying.......

wat is the solution for this.......plz help me out..

with regards,

tony

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

guess you are getting this exception at the statement

JCO.addClientPool ();

this method takes in a Identifier string for the connection pool name and to the best of my knowledge , within one JVM it has to be unique so moment you try to create a new, while one already exists this error will be thrown.

Former Member
0 Kudos

hi,

yes, u have given a right thing...

JCO.addClientPool(poolname,5,......)

here i mentioned 5 suppose if give 1 means what happened ?

it will solve that problem? or any other way

first time executing yes it is coming

second time executing it shows already pool identifier exist.....

with regards,

tony

Former Member
0 Kudos

NO.

if within a program execution you try to create a pool with the same name then it will probably not work and give the error so problem lies with the value of <b>poolname</b>

Ideally , the same program should not create the connection pool multiple times, it should create it once...may be say inside its constructor and rest of the times it should only retrieve the connection from the pool

check this link for sample connection pool usage

http://help.sap.com/saphelp_nw04/helpdata/en/d4/1fe23d44d48e5be10000000a114084/frameset.htm

Former Member
0 Kudos

That's what I said - you should only have 1 connection pool when a program is running. Then get connections from it.

You should also close the connections down when you have finished with them.

Gareth.

Former Member
0 Kudos

hi,

wat u said , it is fine

i think next time we need not to send sap parameters like

( sapclient,user,pwd......)

how should i get that already existed pool reference to make a connection

thanks,

tony

Former Member
0 Kudos

You can indicate SAP to create a pool by doing:

JCO.Pool pool =

JCO.getClientPoolManager().getPool( poolName );

// doesn't exist yet.

if ( pool == null )

{

int maxConnections = 5; // your number

JCO.addClientPool( poolName,

maxConnections,

clientProperties_ );

}

Then you can get a connection from the pool by doing:

JCO.Client sapClient = JCO.getClient( poolName );

then you can do whatever you want (kinda )

Dennis

Former Member
0 Kudos

Are you creating multiple connection pools in a given runtime?

I'm not sure but I'd imagine you should only have 1 connection pool open at a given time (i.e. for a running application from start to finish.)

Gareth.