Announcement Announcement Module
No announcement yet.
JBoss hanging:org.hibernate.jdbc.ConnectionManager] opening JDBC connection Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JBoss hanging:org.hibernate.jdbc.ConnectionManager] opening JDBC connection

    We are using a combination of Spring, Hibernate, and a JBoss cluster of 4 nodes. Occasionally we have a node hang with the server.log ending as so:
    2007-07-26 11:08:59,464 INFO [application] User submission of Form Bean (Login) validation was successful.

    2007-07-26 11:08:59,464 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] Using transaction object [org.springframework.orm.hibernate3.HibernateTransa [email protected]]

    2007-07-26 11:08:59,464 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] Creating new transaction with name [com.innovis.service.IUserService.getUserByUsername]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly

    2007-07-26 11:08:59,464 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4855654561644544

    2007-07-26 11:08:59,464 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] Opened new Session [[email protected]] for Hibernate transaction

    2007-07-26 11:08:59,464 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] Preparing JDBC Connection of Hibernate Session [[email protected]]

    2007-07-26 11:08:59,465 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection

    Here is what our Spring application context xml file looks like:

    <!-- DataSource Definition -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
    <property name="driverClassName">
    <property name="url">
    <value>@[email protected]</value>
    <property name="username">
    <value>@[email protected]</value>
    <property name="password">
    <value>@[email protected]</value>

    <!-- Hibernate SessionFactory Definition -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="mappingResources">
    <property name="hibernateProperties">
    <prop key="hibernate.dialect">org.hibernate.dialect.SQLS erverDialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.cglib.use_reflection_optimizer">tru e</prop>
    <prop key="hibernate.cache.provider_class">org.hibernate .cache.HashtableCacheProvider</prop>
    <prop key="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</prop>
    <property name="dataSource">
    <ref bean="dataSource"/>

    <!-- Spring Data Access Exception Translator Defintion -->
    <bean id="jdbcExceptionTranslator" class="com.innovis.util.InnovisSQLErrorCodeSLQExce ptionTranslator">
    <property name="dataSource"><ref bean="dataSource"/></property>
    <property name="snmpService" ref="snmpService" />

    <!-- Hibernate Template Defintion -->
    <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.Hibernat eTemplate">
    <property name="sessionFactory"><ref bean="sessionFactory"/></property>
    <property name="jdbcExceptionTranslator"><ref bean="jdbcExceptionTranslator"/></property>

    We thought that it might be a database pooling issue, but not sure, can anyone give us an idea? The other 3 nodes of the cluster continue to work, but this one will not do anything until restarted.


  • #2
    I'm having the same problem.


    • #3
      Consider transactions

      Although this is a very late posting against this issue, I ran into it earlier today and found that ensuring that I wrapped my DAO (or service) with @Transactional made this issue go away. Not sure why and i don't have time to fully investigate, but wrapping data access in a transaction is always a good thing to do anyway.

      Some other forums indicate switching away from DBCP and using C3P0 instead. I found that (without transactions) C3P0 held on for longer, but still eventually hung against the same query.

      The tests were conducted in Spring 2.5.5 using Hibernate DBCP was 1.2.2 and C3P0 was

      Maybe this update will help someone.


      • #4
        I did but no improvement.

        Anybody solved this issue??


        • #5

          I'm also running in the the same problem. Tomcat, Spring, Spring Webflow, Hibernate. I couldn't find yet a pattern for reproducing the issue or what can cause it.


          • #6
            Same problem

            we have same problem. spring+hibernate+oracle+dbcp.
            we running in transactional context on the service methods(propagation_required).
            all connections hang for a while like 15 minutes when getting connections and then they run. some time they hang for 1 hour 15 minutes and they run fine after that.