I have had problems with pooling in the past; currently I have an OJB
based app running (against a MySQL db) using the following pooling:
<connection-pool
maxActive="30"
maxIdle="30"
maxWait="1500"
whenExhaustedAction="1"
testOnBorrow="true"
testOnReturn="false"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="10000"
numTestsPerEvictionRun="2"
validationQuery="SHOW TABLES" />
Vincent Frison wrote:
Hi all,
I have sometimes troubles with pooling. One of the most frequent exception is:
An action has failed: Borrow broker from pool failed, using PBKey
org.apache.ojb.broker.PBKey: jcdAlias=default, user=null, password=null
It seems that I explode the broker pool capacity (altough I close brokers as
soon as possible). I'm not very familiar with pooling so please don't blame
me. My poor brain can just understand that there is two different pools: one
for the OJB brokers and optionally another one for the JDBC connections.
Okay. But there is a lot of points which are very dark.
1) Configuring the PB pool
The default values in OJB.properties looks very strange for me:
maxIdle=-1
timeBetweenEvictionRunsMillis=-1
If I read the comments, there's no limit and no eviction for idle brokers, so
it it sounds for me that they can grow indefinitely (even if
whenExhaustedAction != 2)! Or maybe the maxActive value limits idle brokers
too?
2) Configuring the JDBC connections pool
a) Regarding to OJB:
Depending on how OJB brokers handles JDBC connections, is there any rules to
respect when configuring this the pools, e.g. PB pool maxActive > JDBC pool
maxActive? I guess this is not mandatory since OJB brokers use JDBC
connection factory (which could not use pooling btw) and close connections
properly, but i'd like to be sure..
b) <jndi-datasource-name> vs. <connection-pool>:
I use OJB within Tomcat 5.0.x and I have a JNDI DataSource defined in Tomcat
(DBCP Factory). If I want to use it with OJB, I have to declare it in the
<jndi-datasource-name> attribute of <jdbc-connection-descriptor>. In this
case does it mean that OJB don't manage the pool itself and that the
<connection-pool> declaration will be ignored? Is the
ConnectionFactoryDBCPImpl mandatory in that case? Apparently it works better
if I use it (compared to ConnectionFactoryPooledImpl). But if a JNDI
DataSource - which is not implemented with DBCP - is declared in my
container, should I stay with the default implementation?
Thanks a lot..
Vinz
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Robert r. Sanders
Chief Technologist
iPOV
(334) 821-5412
www.ipov.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]