on 07-19-2006 8:36 AM
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
Hi,
Where Can I make a download JCo?
att,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
then notes 950133 and 950134 did not help? In that case, you'd best open an OSS message.
Regards, Heidi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.