on 02-14-2007 10:46 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.