cancel
Showing results for 
Search instead for 
Did you mean: 

JCo v2.1.7 not working where 2.1.6 is working

Former Member
0 Kudos

Hi folks,

yesterday i updated to the new JCo v2.1.7. Formerly i used v2.1.6. Now without any changes to the code i get the following error:

"Trying to use a JCO.Client from pool LD3_186 which has not been allocated properly"

Reverting back to v2.1.6 i realized that everything is working fine. So has anybody seens this error or can tell me why it happens and how to solv it? I cannot understand that a small update breaks all my applications!

I use the following code to obtain a JCo connection:

public synchronized void loadLogonData(String propertyFileName, String poolName, int maxConnections) throws Throwable {

if(propertyFileName == null)

throw new NullPointerException("propertyFileName is null!");

else if(poolName == null)

throw new NullPointerException("poolName is null!");

POOL_NAME = poolName;

JCO.Pool pool = JCO.getClientPoolManager().getPool(POOL_NAME);

if (pool == null) {

logonProperties = OrderedProperties.load(propertyFileName);

JCO.addClientPool(

POOL_NAME, // pool name

maxConnections, // maximum number of connections

logonProperties); // properties

}

}

private synchronized void getConnection() throws Throwable {

if(mConnection != null)

return;

if(mConnection != null && !mConnection.isAlive())

releaseConnection();

mConnection = JCO.getClient(POOL_NAME);

}

public synchronized void releaseConnection() {

mRepository = null;

function = null;

if(mConnection != null)

JCO.releaseClient(mConnection);

}

public synchronized void execute() {

mConnection.execute(function);

}

public synchronized void initFunction(String repository, String name) throws Throwable {

getConnection();

if(mRepository == null)

mRepository = new JCO.Repository(repository, mConnection);

IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());

if (ft == null)

throw new Exception("The function '"name.toUpperCase()"' does not seem to exist!");

function = ft.getFunction();

}

the exception happens at "public synchronized void execute()"

the funny thing is, that only the connection-pooling seems to be faulty, if i try to obtain an connection via the "createClient()" function, it works fine...

any suggestions?

Regards,

Peter

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Where Can I make a download JCo?

att,

Former Member
0 Kudos

One more thing i just realized:

when i replace the following call

mRepository = new JCO.Repository(repository, mConnection);

with this one

mRepository = new JCO.Repository(repository, POOL_NAME);

all works fine!

Why does this work with the old JCo and not with the new v2.1.7??

Regards,

Peter

Former Member
0 Kudos

Hi,

then notes 950133 and 950134 did not help? In that case, you'd best open an OSS message.

Regards, Heidi

Former Member
0 Kudos

Hello Heidi,

i read both notes but only this "might" explain the problem:

"4. Reworked pooling behaviour in order to prevent an unintentional

effects (only connections to SAP Systems below 4.0 are affected)"

but we are using SAP v4.7 so this should not be the cause...