My post started mentioning this:
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
<Resource id="myDBXAPooled" type="DataSource">
XaDataSource myDBXA
DataSourceCreator dbcp
JtaManaged true
UserName *****
Password *********
MaxWait 2000
ValidationQuery SELECT 1
InitialSize 4
MaxActive 10
MaxIdle 5
LogAbandoned true
RemoveAbandoned true
RemoveAbandonedTimeout 20
</Resource>
<Resource id="myDBXA" type="XADataSource"
class-name="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource">
Url jdbc:mysql://********:3306/*******
User *****
Password ***********
</Resource>
</tomee>
Which I thought/think is the right way of configuring
tomee/mysql/XA/pooling.. according to what I have read around.
About the debugger you are right, I sent the value of datasource before its
first usage (getConnection).
Without going too much off-track I just want to add that I am surprised to
see that the real datasource is injected in the connection pool manager only
after its first usage. I thought/hoped that the connections mentioned in
"initialSize" param were created at tomee bootstrap when the resources are
instantiated. But it seems that the completion of the creation of the
resource is only done in a "lazy" way when the resource is used first time.
But this has nothing to do with my original problem of connection-pool not
ensuring a limited predefined number of connections being created.
Anyway..
The new debugger data, after the first "getConnection" is the following,
where xaDataSourceInstance is not null anymore:
ds BasicManagedDataSource (id=123)
abandonedConfig AbandonedConfig (id=141)
accessToUnderlyingConnectionAllowed false
closed false
connectionInitSqls null
connectionPool AbandonedObjectPool (id=101)
connectionProperties Properties (id=143)
dataSource ManagedDataSource (id=146)
defaultAutoCommit true
defaultCatalog null
defaultReadOnly Boolean (id=150)
defaultTransactionIsolation -1
driverClassLoader StandardClassLoader (id=153)
driverClassName "org.hsqldb.jdbcDriver" (id=156)
initialSize 4
jmxDs JMXBasicDataSource (id=160)
logger null
logWriter PrintWriter (id=162)
maxActive 10
maxIdle 5
maxOpenPreparedStatements 0
maxWait 2000
minEvictableIdleTimeMillis 1800000
minIdle 0
numTestsPerEvictionRun 3
password "15Asennu51" (id=167)
passwordCipher "PlainText" (id=168)
poolPreparedStatements false
restartNeeded true
testOnBorrow true
testOnReturn false
testWhileIdle false
timeBetweenEvictionRunsMillis -1
transactionManager GeronimoTransactionManager (id=169)
transactionRegistry TransactionRegistry (id=108)
url
"jdbc:hsqldb:file:E:\\SirtomauWorkspace\\mysql-src\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp3\\data\\hsqldb\\hsqldb"
(id=173)
username "root" (id=182)
validationQuery "SELECT 1" (id=183)
validationQueryTimeout -1
xaDataSource "com.sun.proxy.$Proxy77" (id=184)
hash 0
hash32 0
value (id=223)
xaDataSourceInstance $Proxy77 (id=185)
h XADataSourceResource$LazyXADataSourceHandler (id=190)
name "openejb:Resource/bulkerXA" (id=194)
hash 0
hash32 0
value (id=205)
ref AtomicReference<V> (id=195)
value MysqlXADataSource (id=198)
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/org-apache-openejb-resource-jdbc-dbcp-BasicManagedDataSource-allocating-more-than-MaxActive-connectis-tp4676508p4676518.html
Sent from the TomEE Users mailing list archive at Nabble.com.