-->
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.  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Wed Sep 28, 2005 3:25 am 
Newbie

Joined: Tue Sep 27, 2005 4:07 pm
Posts: 7
Thank a lot for your answer.

But is there a possiblility to see if this new parameters have been read and integrate by Hibernate ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 9:16 am 
Newbie

Joined: Mon Jan 17, 2005 5:59 pm
Posts: 6
Location: Canada
If you turn on logging (I use log4j) then you can see the properties with INFO level for the com.mchange.v2.c3p0.PoolBackedDataSource class.

2005-09-28 09:11:51,874 [Thread-1 ] INFO com.mchange.v2.c3p0.PoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@16dba0a [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@3da850 [ acquireIncrement -> 1, acquireRetryAttempts -> 0, acquireRetryDelay -> 30000, autoCommitOnClose -> false, automaticTestTable -> TEST_TABLE, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 3da850, idleConnectionTestPeriod -> 5, initialPoolSize -> 1, maxIdleTime -> 300, maxPoolSize -> 1, maxStatements -> 100, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1566a6c [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1566a6c, jdbcUrl -> jdbc:oracle:thin:@machinename:1521:databasename, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> true, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 16dba0a, numHelperThreads -> 3 ]


Top
 Profile  
 
 Post subject: c3p0 parameters values
PostPosted: Fri Jan 20, 2006 7:51 am 
Newbie

Joined: Fri Jan 20, 2006 7:07 am
Posts: 2
Location: Italy
Hi all,
i'm developing a CAA (Computer Aided Assessment) application with Struts,Hibernate,Jboss,Firebird database. i've tested my application, simulating a University exam test with about 45 students, and all gone very slow. So i noted that i've used hibernate default connections pool manager with these parameters :
hibernate.connection.pool_size = 1
hibernate.statement_cache.size = 25.
Is this the cause of slow perfomance of my application? i tried to substitute the hibernate default connections pool manager with c3p0 library, and set c3p0 properties:
hibernate.c3p0.min_size=15
hibernate.c3p0.max_size=50
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statement=50
Can anyone tell me what values of these properties are good for my application?
thanks to all for attention, and sorry for my english :-)


Top
 Profile  
 
 Post subject: only acquireRetryAttempts paramter not taken.
PostPosted: Thu Apr 06, 2006 9:33 pm 
Newbie

Joined: Wed Jun 22, 2005 4:33 pm
Posts: 1
I use Hibernate 3.01, and set c3p0 as pooling service. in my hibernate.cfg.xml, I have settings below, all other parameters are taken properly, but acquireRetryAttempts is not, it still use the default Value (30).

<property name="c3p0.min_size">2</property>
<property name="c3p0.max_size">10</property>
<property name="c3p0.timeout">1800</property>
<property name="c3p0.acquireRetryAttempts">4</property>
<property name="c3p0.acquireIncrement">1</property>
<property name="c3p0.idleConnectionTestPeriod">36000</property>
<property name="c3p0.initialPoolSize">2</property>
<property name="c3p0.maxPoolSize">10</property>
<property name="c3p0.maxIdleTime">1200</property>
<property name="c3p0.maxStatements">30</property>
<property name="c3p0.minPoolSize">2</property>


[Full GC 53428K->47855K(130112K), 0.4752277 secs]
2006-04-06 18:16:57,068 INFO (C3P0ConnectionProvider.java:50) - C3P0 using driver: oracle.jdbc.driver.OracleDriver at U
RL: jdbc:oracle:thin:@10.2.3.189:1529:devdb
2006-04-06 18:16:57,068 INFO (C3P0ConnectionProvider.java:51) - Connection properties: {user=dwapp, password=****, zero
DateTimeBehavior=round}
2006-04-06 18:16:57,068 INFO (C3P0ConnectionProvider.java:54) - autocommit mode: false
2006-04-06 18:16:57,146 INFO (MLog.java:80) - MLog clients using log4j logging.
2006-04-06 18:16:57,224 INFO (C3P0Registry.java:87) - Initializing c3p0-0.9.1-pre6 [built 23-March-2006 16:11:59 +0200;
debug? true; trace: 10]
[GC 55983K->48185K(130112K), 0.0100275 secs]
2006-04-06 18:16:57,411 INFO (PoolBackedDataSource.java:269) - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBacked
DataSource@1dd3f8a [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@1e90245 [ acquireIn
crement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> n
ull, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.Defa
ultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1e90245,
idleConnectionTestPeriod -> 0, initialPoolSize -> 2, maxIdleTime -> 1800, maxPoolSize -> 10, maxStatements -> 0, maxSta
tementsPerConnection -> 0, minPoolSize -> 2, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1961cca [ d
escription -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1961cca, jdbcUrl -> jdbc:oracle:
thin:@10.2.3.189:1529:devdb, properties -> {user=******, password=******, zeroDateTimeBehavior=round} ], preferredTestQu
ery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalR
eflectiveProxies -> false; userOverrides: {} ], dataSourceName -> 1dd3f8a, factoryClassLocation -> null, identityToken -
> 1dd3f8a, numHelperThreads -> 3 ]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 15, 2008 10:28 am 
Newbie

Joined: Thu Aug 14, 2008 10:08 am
Posts: 2
Hi I am newbie to hibernate, I am developing a simple GUI application which uses hibernate. In my application I am using c3p0 for connection pooling. When my application is trying to access database when it is down, I am getting the following exception after 10 mins, meanwhile GUI application becomes unresponsive.

Cannot open connection
org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)


Here is what my application has to do, if the underlying database is down while accessing, it has to show an a message and exit smoothly but in some reasonable amount of time, 10 mins is too long to wait. Which property determines the delay in the propagation of the exception to the client when database is down ?

I tried with changing maxAdministrativeTaskTime and acquireRetryAttempts but irrespective of their changes it always taking 10 mins to throw an exception. Am I missing any details here ?

Here are the test properties I am using in my application

c3p0-config.xml

<c3p0-config>
<default-config>
<property name="acquireRetryDelay">1000</property>
<property name="acquireRetryAttempts">2</property>
<property name="breakAfterAcquireFailure">false</property>
<property name="maxAdministrativeTaskTime">120</property>
<property name="initialPoolSize">1</property>
</default-config>
</c3p0-config>

some of the c3p0 properties in hibernate.cfg.xml

<property name="c3p0.min_size">1</property>
<property name="c3p0.max_size">1</property>
<property name="c3p0.idle_test_period">120</property>
<property name="c3p0.timeout">120</property>

Thanks in advance for your help.

_________________
+Venu


Top
 Profile  
 
 Post subject: Re: c3p0 pool configuration
PostPosted: Fri May 25, 2012 7:26 am 
Newbie

Joined: Fri May 25, 2012 1:14 am
Posts: 2
Hi

I am using hibernate 3.2.6jar but I am not using any c3p0.properties file. the below are my logs which was generated when I got some exception. Can anyone tell me, If I will use c3p0.properties file in the classpath & increases the by defualt values(mentioned below in the stack trace) which were generated through hibernate jar(that I think ), then who will get the precedence, the new property file (c3p0.properties )or the stack trace value defined below will remain the same?????

I want to use the property file as I ran out of resources and got these exceptions:SEVERE: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource@8237b39c

java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource@8237b39c [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@7adf8ced [ acquireIncrement -> 2, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure yo-> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 155h2bp8n3w3nui6k9dbe|16136f0, idleConnectionTestPeriod -> 60, initialPoolSize -> 5, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 360, maxIdleTimeExcessConnections -
> 0, maxPoolSize -> 100, maxStatements -> 75, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@8334d6f3 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 155h2bp8n3w3nui6k9dbe|113e8f3, jdbcUrl -> jdbc:oracle:oci:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cnlxrd43)(PORT = 1526)) (ADDRESS = (PROTOCOL = TCP)(HOST = cnlxrd42)(PORT = 1526)) (ADDRESS = (PROTOCOL = TCP)(HOST = cnlxrd41)(PORT = 1526)) (ADDRESS = (PROTOCOL = TCP)(HOST = cnlxrd44)(PORT = 1526)) (enable=broken) (FAILOVER = ON) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AEU) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5)))), properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 155h2bp8n3w3nui6k9dbe|10dd4c8, numHelperThreads -> 100 ] has been closed() -- u can no longer use it.
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.assertCpds(AbstractPoolBackedDataSource.java:447)
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page Previous  1, 2

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.