This is brief description of the PersistenceBroker issue which we faced in MSU and fixed :
Actaully there is a file called OJB.properties which is used while initializing the OJB configuration during the application start up.
We have a property called maxActive which specifies the number of persistenceBrokers that are available at a point of time .
Since we use OJB as ORM access to each db call is made through the PersistenceBroker object.
Edocs in PURAP module like Requisition and recurring PREQS makes use of lot of PB objects eventually exceeding the max active count as a result this
exception usually arises :
org.springframework.dao.DataAccessResourceFailureException: Could not open OJB PersistenceBroker; nested exception is org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=enWorkflowDataSource, user=null, password=null

at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(PersistenceBrokerFactoryDefaultImpl.java:120)

at org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl.createPersistenceBroker(PersistenceBrokerFactorySyncImpl.java:122)

at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(PersistenceBrokerFactory.java:104)

at org.springmodules.orm.ojb.OjbFactoryUtils.getPersistenceBroker(OjbFactoryUtils.java:86)

at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getPersistenceBroker(PersistenceBrokerTemplate.java:286)

at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:139)

at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getReportQueryIteratorByQuery(PersistenceBrokerTemplate.java:209)

Caused by: java.util.NoSuchElementException

at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:758)

... 160 more

The above exception describes the pool maintained by PersistenceBrokerFactoryDefaultImpl the factory implementation which is responsible for
maintaining the life cycle of PersistencBroker object is running out of objects since the limit is reached .

When ever we make a call to DB for doing any operations the currently running thread checks whether it is bound to a Transaction Manager if it founds a transaction
then from it tries to find the PB object bound to the current thread and releases it back to the pool after finishing , if it is not bound to any transaction manager
then each operation to the DB borrows separate brokers and returns it to pool after it finishes.