PooledDataSource forcefully closed/removed all connections.

1,005 views
Skip to first unread message

iref

unread,
Jan 25, 2011, 5:22:39 AM1/25/11
to mybatis-user
Hi,

I am using Pooled Datasource for connecting to db, i am loading
connection properties from property file and everything works fine,
but after datasource is created and log4j is initialized datasource is
forced to close all connections to database.

here is my config file:

<environment id="through-properties">
<transactionManager type="JDBC" />
<dataSource type="POOLED">
<property name="driver" value="${db_driver}" />
<property name="url" value="${db_url}" />
<property name="username" value="${db_username}" />
<property name="password" value="${db_password}" />
</dataSource>
</environment>

and log record:

INFO c.c.config.AbstractDatabaseConfiguration[182] - Properties
loaded from [jar:file:/home/xxx/app.jar!/database.properties].
DEBUG c.c.config.AbstractDatabaseConfiguration[63] - Creating
database config from XML file [com/company/config/database.xml].
DEBUG org.apache.ibatis.logging.LogFactory[28] -
Logging initialized using 'org.apache.ibatis.logging.slf4j.Slf4jImpl'
adapter.
DEBUG o.apache.ibatis.datasource.pooled.PooledDataSource[28] -
PooledDataSource forcefully closed/removed all connections.
DEBUG o.apache.ibatis.datasource.pooled.PooledDataSource[28] -
PooledDataSource forcefully closed/removed all connections.
DEBUG o.apache.ibatis.datasource.pooled.PooledDataSource[28] -
PooledDataSource forcefully closed/removed all connections.
DEBUG o.apache.ibatis.datasource.pooled.PooledDataSource[28] -
PooledDataSource forcefully closed/removed all connections.


Do anyone know any possible what might have caused this problem?
Thanks for help
Jan

Hunter

unread,
Jan 25, 2011, 9:17:49 PM1/25/11
to mybatis-user
This may be a spurious message. All the set methods in
PooledDataSource call forceCloseAll(), which closes all the existing
connections under the assumption that you just changed the
characteristics of the pool. If you are creating a pool then
immediately setting properties on it, you will get this message even
if there have not actually been any Connections created. To verify,
you can query the PoolState object (it has a comprehensive toString())
from the pool.

iref

unread,
Jan 27, 2011, 7:45:42 AM1/27/11
to mybatis-user
Thanks Hunter,

I found out that problem hadn' t been in mybatis but in Spring bean
injection.
Reply all
Reply to author
Forward
0 new messages