Announcement Announcement Module
Collapse
No announcement yet.
JBoss hanging:org.hibernate.jdbc.ConnectionManager] opening JDBC connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 ctionManager$HibernateTransactionObject@e3fad3]

    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 [org.hibernate.impl.SessionImpl@1686457] for Hibernate transaction

    2007-07-26 11:08:59,464 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@1686457]

    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">
    <value>net.sourceforge.jtds.jdbc.Driver</value>
    </property>
    <property name="url">
    <value>@jdbc.driver.url@</value>
    </property>
    <property name="username">
    <value>@server.db.username@</value>
    </property>
    <property name="password">
    <value>@server.db.password@</value>
    </property>
    </bean>

    <!-- Hibernate SessionFactory Definition -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="mappingResources">
    <list>
    <value>com/innovis/domain/User.hbm.xml</value>
    <value>com/innovis/domain/Order.hbm.xml</value>
    <value>com/innovis/domain/PasswordHistory.hbm.xml</value>
    <value>com/innovis/domain/PasswordRecall.hbm.xml</value>
    <value>com/innovis/domain/SessionTracking.hbm.xml</value>
    <value>com/innovis/domain/ConsumerLock.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <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>
    </props>
    </property>
    <property name="dataSource">
    <ref bean="dataSource"/>
    </property></bean>

    <!-- 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" />
    </bean>

    <!-- 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>
    </bean>

    ***********************************************
    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.

    Thanks!

  • #2
    I'm having the same problem.

    Comment


    • #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 3.2.6.ga. DBCP was 1.2.2 and C3P0 was 0.9.1.1.

      Maybe this update will help someone.

      Comment


      • #4
        I did but no improvement.

        http://forum.springsource.org/showth...898#post285898

        Anybody solved this issue??

        Comment


        • #5
          same

          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.

          Comment


          • #6
            Same problem

            Hi
            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.
            thanks

            Comment

            Working...
            X