Hi All,
I needed to add an additional data source to an appfuse 2.0 spring MVC &
hibernate project. However after a few days of extremely light usage of the
data source in product the following exception is thrown:
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool
error Timeout waiting for idle object
at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at
org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
I set up the second data source as follows by adding beans for a
HibernateTransactionManager, a AnnotationSessionFactoryBean and a
BasicDataSource:
<bean id="dataSourceReporting"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="jdbc:oracle:thin:@10.XX.XX.XX:1521:XE"/>
<property name="username" value="SYSTEM"/>
<property name="password" value="password"/>
<property name="maxActive" value="100"/>
<property name="maxWait" value="1000"/>
<property name="poolPreparedStatements" value="true"/>
<property name="defaultAutoCommit" value="true"/>
</bean>
<!-- Hibernate SessionFactory For Reporting Data Base -->
<bean id="sessionFactoryReporting"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSourceReporting"/>
<property name="configLocation"
value="classpath:hibernate.cfg.xml"/>
<property name="hibernateProperties">
<value>
hibernate.dialect=${hibernate.dialect}
hibernate.query.substitutions=true 'Y', false 'N'
hibernate.cache.use_second_level_cache=true
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
</value>
</property>
</bean>
<bean id="transactionManagerReporting"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactoryReporting"/>
</bean>
The dao that accesses this data source extends GenericDaoHibernate. The dao
uses getSession().createSQLQuery. I am not closing these connections as I
far as I understand that once the transaction is complete the spring will
close the connection for me as the session is bound to the thread.
Has anyone any idea of what the problem might be?
Cheers
Abu
--
View this message in context:
http://www.nabble.com/Additional-data-source-causing-org.apache.commons.dbcp.SQLNestedException-tp18067093s2369p18067093.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]