OJB use a PersistenceBroker instances pool and if enabled a connection pool. In your case the PB-pool seems to be exhausted. This is surprisingly, because per default PB-pool size was 100 and connection-pool size was 20. If you do an query/insert/... operation each PB use a connection, so I would expect that the connection pool will be exhausted before the PB-pool, except somewhere you ask for a PB instance, do not use any DB operation method and forget to close the instance (or use more than 100 concurrent).
> I also call broker.close() in the finally clause of every try/catch > block of my data access objects. Should I be calling broker.close() > right after the transaction in the try clause instead of the finally > clause?
Using a finally is best practices
> I'm using Oracle 8i and only see one active connection to the database, > so the max number of connections are not being exceeded. >
This is surprisingly again.
> Is there anyway to log how many PersistenceBrokers are in the pool and > if they are being released properly? >
Active PB instances can be checked by (undocumented) PersistenceBrokerFactoryFactory.instance().activePersistenceBroker()
> If it helps, every time I reload my webapp, the memory usage goes up > and never gets reclaimed. If I get close to the maximum heap, the > program will run out of memory.
hmm, don't know if this is caused by OJB. Did your webApp reload all OJB classes and used libraries or only your web classes?
regards, Armin
Anthony Carlos wrote:
Hello OJB gurus:
I'm running up against this error message:
java.util.NoSuchElementException
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic KeyedObjectPool.java:770)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPer sistenceBroker(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.defaultPe rsistenceBroker(Unknown Source)
at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker( Unknown Source)
at com.digitalphenom.common.ServiceLocator.findBroker(ServiceLocator.java: 33)
...
I found the previous posts regarding this in the following article: http://www.mail-archive.com/[EMAIL PROTECTED]/msg05670.html
As the article predicts, I am using ConnectionFactoryPooledImpl and whenExhaustedAction=0 in my OJB.properties file.
I also call broker.close() in the finally clause of every try/catch block of my data access objects. Should I be calling broker.close() right after the transaction in the try clause instead of the finally clause?
I'm using Oracle 8i and only see one active connection to the database, so the max number of connections are not being exceeded.
Is there anyway to log how many PersistenceBrokers are in the pool and if they are being released properly?
If it helps, every time I reload my webapp, the memory usage goes up and never gets reclaimed. If I get close to the maximum heap, the program will run out of memory.
Thus, I believe that connections are not being released properly.
Thanks,
-Anthony Carlos
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
