Hi,
First, sorry for my very bad English. ;)
I'm new user in OJB, and I have a problem with connection-pool. I'm
using an environment with EJB and OJB.
To obtain a broker in a DAO class that only execute queries I'm using a
singleton class (ServiceLocator):
PersistenceBroker broker = ServiceLocator.getInstance().findBroker();
The method findBroker() is:
public PersistenceBroker findBroker() throws ServiceLocatorException {
PersistenceBroker broker = null;
try {
broker =
PersistenceBrokerFactoryFactory.instance().defaultPersistenceBroker();
} catch (PBFactoryException e) {
e.printStackTrace();
throw new ServiceLocatorException("PBFactoryException error
occurred while parsing the repository.xml file in ServiceLocator
constructor", e);
}
return broker;
}
When I need to execute an store in DB, I'm using EJB. To obtain a broker
when I use EJB method, I'm using OjbStartup class.
PersistenceBroker broker =
ojbPbFactory.getInstance().defaultPersistenceBroker();
OjbPbStartup is the same that there is into:
http://db.apache.org/ojb/docu/guides/deployment.html
The problem is that when I obtain a broker with OjbPbStartup class, the
appServer opens 10 connections more (parameter minConnections in
datasources.xml), and then I have 20 connections to the DB when I only
want to have 10.
I don't know if I explained me well.
Thanks for any help,
Joan Miralles Ramis
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]