-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: c3p0 + mysql problem
PostPosted: Fri Oct 14, 2005 4:03 pm 
Newbie

Joined: Tue Apr 05, 2005 7:01 am
Posts: 8
Hi,

I'm having trouble making C3P0 to work. Using the hibernate internal connection pooling, everything is Ok. As soon as I swith to C3P0 setting the (hibernate.c3p0.max_size property), I get the error log below when hibernate tries to get a connection.

Any ideas ?

Bruno

My hibernate config file:
======================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLMyISAMDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
<property name="hibernate.connection.password">mypass</property>
<property name="hibernate.connection.username">root</property>

<property name="hibernate.c3p0.max_size">10</property>

<property name="hibernate.jdbc.batch_versioned_data">true</property>
<property name="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="hibernate.cache.region_prefix">hibernate.test</property>
<property name="hibernate.proxool.pool_alias">pool1</property>
<property name="hibernate.default_batch_fetch_size">8</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<property name="hibernate.max_fetch_depth">1</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.order_updates">true</property>
</session-factory>
</hibernate-configuration>
======================


Hibernate version:
3.1 beta1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
MySQL 4.1.10a-nt

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
15:54:54,821 org.hibernate.util.JDBCExceptionReporter WARN - SQL Error: 0, SQLState: null
15:54:54,821 org.hibernate.util.JDBCExceptionReporter ERROR - com.mchange.v2.c3p0.PoolBackedDataSource@1d18ac9 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@17d2a06 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 17d2a06, idleConnectionTestPeriod -> 0, initialPoolSize -> 1, maxIdleTime -> 0, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1db296e [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1db296e, jdbcUrl -> jdbc:mysql://localhost/test, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 1d18ac9, numHelperThreads -> 3 ] has been closed() -- you can no longer use it.
15:54:54,821 net.sf.oreka.services.RecSegmentServiceHbn ERROR - org.hibernate.exception.GenericJDBCException: Cannot open connection


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 5:04 am 
Newbie

Joined: Wed Apr 05, 2006 5:03 am
Posts: 1
hey i am also facing the same problem :(
if you have the solution please let me know
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 9:32 am 
Newbie

Joined: Tue Apr 05, 2005 7:01 am
Posts: 8
Hi,

The solution to my problem was to switch to proxool :)

You can have a look at my code here:

http://cvs.sourceforge.net/viewcvs.py/o ... iew=markup

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 5:17 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
Hi.

I'm having the same problem.
Do anyone know what could be the cause of this?

If I don't use C3P0 I have a problem with MySQL timing out after ~8h of inactivity.
The recomended solution was to use C3P0 with
acquireRetryAttempts and acquireRetryDelay, but now when I try to use it I get this error..

Please help!

_________________
/ted


Top
 Profile  
 
 Post subject: Still not solved
PostPosted: Sun May 21, 2006 11:30 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
Anyone that has solved this problem yet?
If so, I would be really glad to here how.

I get errors if I don't use C3P0 and I get them when I use C3P0
in the first case the connection times out after a few hours in the latter hibernate cannot open the connection at all. :(

_________________
/ted


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.