You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Vesa Hirsimaa <ve...@dsine.net> on 2003/05/02 14:30:52 UTC
PBPool runs out?
Hi!
I've problems with the PersistenceBroker.
It looks like my PBPool runs out and I get "Borrow broker from pool
failed" error messages into logfile. This occurs when I do multiple
requests at the same time.
I'm using ODMG api, Sybase ASE 12.5 and OJB-rc2.
The following snippet shows how I've done the data retrieving. Am I
doing something wrong?
-----
public ArrayList getObjectsById( int id ) {
ArrayList objects = new ArrayList();
List results = null;
try {
Transaction tx = odmg.newTransaction();
tx.begin();
OQLQuery query = odmg.newOQLQuery();
String queryStr = new String(
"select o from " + SomeObject.class.getName()
+ " where id = $1" );
query.create( queryStr );
query.bind( new Integer( id ).toString() );
results = (List) query.execute();
for( int i = 0; i < results.size(); i++ ) {
SomeObjectProxy obj = (SomeObjectProxy) results.get(i);
objects.add( obj );
}
tx.commit();
} catch( Exception ex ) {
ex.printStackTrace();
}
return objects;
}
-----
I have the following values in the
OJB.properties/PersistenceBrokerFactory pool -section :
maxActive=100
maxIdle=-1
maxWait=2000
timeBetweenEvictionRunsMillis=-1
minEvictableIdleTimeMillis=1000000
whenExhaustedAction=0
-----
Thanks,
Vesa.