Hi,
I need some help with OJB stuff.
I'm currently using OJB and I found this problem that in a particular file, I get this
message :
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Already cre
ated persistence broker instances: 2
every time I refresh that page. The number of broker instances increases every time I
refresh the page.
My code looks like this :
PersistenceBroker broker = null;
try
{
broker = PersistenceBrokerFactory.createPersistenceBroker( new PBKey( ...
) );
broker.beginTransaction();
... ...
... (my own stuff)
broker.commitTransaction();
}
catch (Exception ex)
{
ex.printStackTrace();
broker.abortTransaction();
}
finally
{
if( broker != null )
broker.close();
}
The problem is, when the maximum number of brokers that can be borrowed from the pool
(specified in OJB.properties file) is reached, the server crashed. Can anyone explain
to me why this is happening ? This problem doesn't happen in other pages, which uses
similar code for connections to the database.
I'd be very grateful if someone can help me.
Regards,
Dany