Hi Rick,

Rick Banerjee wrote:

Hi Armin, Hello Everyone,

Sorry to take so long to reply! Was trying as many combinations
as possible!

I'm using OJB within a servlet in a managed environment. That is
to say, I'm using OJB in the DAO layer of a Struts application
running in the SunONE application server.

As for the stack trace, I'm getting stuff in the stack trace saying:

org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=, user=null, password=null

It looks like I'm running out of brokers? So, where do I set the
maxActive? In OJB.properties? In repository.xml?


In OJB.properties section PersistenceBroker pool.
Do you run a massive multithreaded test (default size of broker pool is 100)? If not, please check your code maybe you forget to call PB.close() in source.



If I comment out all the values in OJB.properties related to the
broker pool and have the entries only in repository.xml, is that
OK?


No, the broker pool can only be set in OJB.properties file.


Also, the entries in the OJB.properties & repository.xml, like maxActive, maxIdle are related to the broker pool or the database connection pool?


In repository.xml you can set properties for the connection pool using the 'connection-pool' element within the jdbc-connection-descriptor, if the used ConnectionFactory (specified in OJB.properties file) support connection pooling (the broker pool and the connection pool are completely different!).



And, since I'm running OJB within an app server and using a
JNDI lookup for the datasource, should I neccessarily use
#ConnectionFactoryClass=
org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl?


Above you say that you use OJB in a managed environment (transaction, security, and connection management done by the appServer), thus the serlets use JTA to manage transactions and the used DataSource was "bound to" JTA (tx-management is done by the appServer and you use UserTransaction or similar stuff in your servlets)? If this is the case, the answer is yes.
Then tx-demarcation/management for OJB should be done via JTA(/JTS) too and UserTransation should be used instead of the local tx-demarcation by PB.beginTransaction/.....
In OJB.properties file you should set properties for use in managed environments described here
http://db.apache.org/ojb/docu/guides/deployment.html#Configure+OJB+for+managed+environments+considering+as+JBoss+example


If you only use the appServer connection pool and nothing more, the answer is no.


As you can see, I'm really confused. :-)


hope I don't force up confusion ;-)

regards,
Armin


Could you please help me?
I'm at my wits end and still haven't fixed this problem. Have to move to production soon! :-((



--------------------------------------------------------------------- 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]



Reply via email to