Hi

I've noticed an interesting thing with my servicemix application
I'm using smx4
my application uses hibernate 3 for db interactions

I noticed that I deploy my sa (servicemix-assembly) and run the application
and the application is running fine. However, after a long idle time (2
days), if I put a request I see that the application is not able to connect
to the db and returns a "Connection refused" exception though the database
is up that time and I can access the db using toad etc. However, if I
redeploy the sa, the application seems to be running fine again.

Can anybody know the potential reason of this error?

I've reproduced the same scenario using the following steps:
Note: servicemix is running in my local setup. db server is in a remote m/c
1. deploy the sa in servicemix
2. test if the application is running or not (it's running now)
3. un-plug the n/w cable to make sure that the servicemix is disconnected
from db server.
4. plug the cable back in.
5. test if the application is running or not (it's not running this time and
giving "Connection refused" exception.

Below is the content of my hibernate.cfg.xml
======================================
<?xml version="1.0" encoding="UTF-8"?>
&lt;!DOCTYPE hibernate-configuration PUBLIC 
        &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;      

&quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
<hibernate-configuration>
        <session-factory>
                <property
name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
                <property
name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
                
                <property
name="hibernate.connection.url">jdbc:oracle:thin:@1.2.3.4:1521:DBUser</property>
                <property name="hibernate.default_schema">DBUser</property>
                <property name="hibernate.connection.username">DBUser</property>
                <property 
name="hibernate.connection.password">*******</property>
                <property name="connection.pool_size">10</property>
                <property name="show_sql">true</property>
                <property name="current_session_context_class">thread</property>
                
                
                <mapping 
class="com.abacus.amh.dbaccess.hibernate.model.AWSSession" />

</session-factory>
</hibernate-configuration>




--
View this message in context: 
http://servicemix.396122.n5.nabble.com/servicemix-can-not-gain-db-connection-after-a-long-idle-time-tp4654426p4654426.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to