2 Replies Latest reply on Apr 10, 2009 3:00 AM by Chatura kalansooriya

    JbossESB and Connection Pooling Problem

    Anonymous User Newbie

      Hello Forum and experts,

      I have some problems with JBossEsb Message store and Connection Pooling. Before I start to define my problem, the following assumptions:

      - JbossEsb MessageStore is set up on Oracle Database.
      - The message store datasoruce looks like this in jboss.esb\message-store-ds.xml:

      
       <local-tx-datasource>
       <jndi-name>JBossESBDS</jndi-name>
       <!-- use for in-process db -->
       <connection-url>jdbc:oracle:thin:@xxx:yyy</connection-url>
       <!-- use for server mode (over tcp)
       <connection-url>jdbc:hsqldb:hsql://${jboss.esb.bind.address}:9001/</connection-url>
       -->
       <driver-class>oracle.jdbc.OracleDriver</driver-class>
       <user-name>xxxx</user-name>
       <password>yyyy</password>
       <min-pool-size>5</min-pool-size>
       <max-pool-size>20</max-pool-size>
       <idle-timeout-minutes>0</idle-timeout-minutes>
       <prepared-statement-cache-size>32</prepared-statement-cache-size>
       <connection-property name="autoReconnect">true</connection-property>
      
       <metadata>
       <type-mapping>Oracle10</type-mapping>
       </metadata>
       <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
      
       </local-tx-datasource>
      
      


      Now to the definition of my problem. The JBossESB works fine and all my services run correctly, but when oracle database is immediately showdown and restarted while JBossESB is running, this causes some problems with JbossEsb Message Store. If Oracle database is immediately shutdown I would expect that the message store - connection from the pool is closed and given back to the pool as it is not valid any more. I get the following warning in the server.log:

      WARN [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Destroying connection that is not valid, due to the following exception: oracle.jdbc.driver.T4CConnection@1abf87c
      


      After successfully restarting the database, JBossEsb requests for a new connection at the datasource for JbossESB Message Store (JBOSSESBDS). Furthermore I would expect that JBOSSESBDS gets a new pooled connection from the pool. Still this results in the following warnings:

      2009-04-04 21:22:15,350 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Unable to fill pool
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: The Network Adapter could not establish the connection)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:524)
       at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
       at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
       at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
       at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
       at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
       at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
       ... 4 more
      


      Did JBOSSESBDS forget to give back the connection to the pool and still holds an old faulty, not valid conenction for JbossEsb ? Maybe I forget some hidden parmeter in the configuration, which can handle this ?

      Best regards,

      Dennis