Results 1 to 10 of 42

Thread: configuration help: pool problems create deadlocks

Threaded View

  1. #1
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Exclamation configuration help: pool problems create deadlocks

    hello guys

    i am in trouble with deadlocks about pool control

    in my project with Spring for database section i work with Hibernate and for jasper reports i work with the classic jdbc

    today, after to almost 30 minutes of test, my application is suddenly dead , stop
    after to done thread dump

    i see this part
    Code:
    "http-8080-Processor23" daemon prio=1 tid=0xa8624a20 nid=0x1a09 in Object.wait() [0xa72f9000..0xa72fae40]
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0xab3e47e8> (a com.mchange.v2.resourcepool.BasicResourcePool)
    	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:968)
    	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
    	- locked <0xab3e47e8> (a com.mchange.v2.resourcepool.BasicResourcePool)
    	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:260)
    	at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
    	at com.mchange.v2.c3p0.ComboPooledDataSource.getConnection(ComboPooledDataSource.java:521)
    	at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
    	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
    	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
    	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
    	at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:497)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349)
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:255)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
    	at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:616)
    	at com.lagranjita.modelo.bo.implementaciones.concretos.ConcreteCabeceraCuentaProveedoresImpl$$EnhancerByCGLIB$$61ebcf9a.getAllCabeceraCuentaProveedoresInFormalesBO(<generated>)
    after to see some threads i have this configuration
    (remember that i work with Hibernate and jdbc)

    i have only 2 context for configuration for the db

    One: for general db connection
    Code:
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">							 
            <property name="driverClass">
                <value>com.mysql.jdbc.Driver</value>
            </property>
            <property name="jdbcUrl">
    		<value>jdbc:mysql://localhost:3306/mydb</value>
            </property>
            <property name="user">
                <value>someuser</value>
            </property>
            <property name="password">
                <value>somepassword</value>
            </property>
            <property name="acquireIncrement">
                <value>3</value>
            </property>
            <property name="minPoolSize">
                <value>6</value>
            </property>
            <property name="maxPoolSize">
                <value>26</value>
            </property>
            <property name="maxStatementsPerConnection">
                <value>100</value>
            </property>
            <property name="idleConnectionTestPeriod" >
                <value>3000</value>
            </property>
            <property name="automaticTestTable">
                <value>c3p0_test_table</value>
            </property>
            <property name="numHelperThreads">
                <value>20</value>
            </property>
        </bean>
    Two: for hibernate
    Code:
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    	<property name="dataSource">
    		<ref bean="dataSource"/>
    	</property>
    	<property name="mappingResources">
    		<list>a lot of hhm files </list>
    	</property>
    	<property name="hibernateProperties">
    		<props>
            	<!-- SQL dialect -->
    		<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
    
                    <!-- JDBC connection pool (use the built-in) -->
    		<!-- <prop key="hibernate.connection.pool_size" >1</prop>  -->
    
    		<!-- Enable Hibernate's automatic session context management -->
    		<prop key="hibernate.current_session_context_class" >thread</prop>
    
    		<!-- Disable the second-level cache  -->
    	 	<prop key="hibernate.cache.provider_class" >org.hibernate.cache.NoCacheProvider</prop>
    
    		<!-- Echo all executed SQL to stdout -->
    		<prop key="hibernate.show_sql" >true</prop>			
    					
    		<!-- Drop and re-create the database schema on startup -->
     		<prop key="hibernate.hbm2ddl.auto" >create-drop</prop> 
    
    <!-- 
    		<prop key="hibernate.c3p0.min_size" >5</prop>
    		<prop key="hibernate.c3p0.max_size" >20</prop>									<prop key="hibernate.c3p0.timeout" >300</prop>
    		<prop key="hibernate.c3p0.max_statements" >50</prop>							<prop key="hibernate.c3p0.idle_test_preriod" >3000</prop>
     -->										
    	     </props>
          </property>
    </bean>   
    
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="sessionFactory">
    			<ref bean="sessionFactory"/>
    		</property>
    </bean>				
    <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
       	     <property name="sessionFactory">
            	   <ref bean="sessionFactory"/>
             	</property>
    </bean>
    so pls, what is wrong in my configuration???
    i think that our members has the correct configuration

    share your configuration

    thanks for advanced
    Last edited by dr_pompeii; Jun 24th, 2007 at 11:42 AM.
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •