c3p0-users Mailing List for c3p0:JDBC DataSources/Resource Pools
Status: Beta
Brought to you by:
swaldman
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
(11) |
Aug
(2) |
Sep
(2) |
Oct
(17) |
Nov
(18) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(13) |
Feb
(12) |
Mar
(16) |
Apr
(16) |
May
(14) |
Jun
(27) |
Jul
(6) |
Aug
(4) |
Sep
(1) |
Oct
(11) |
Nov
(8) |
Dec
(8) |
2008 |
Jan
(5) |
Feb
(2) |
Mar
(12) |
Apr
(9) |
May
(4) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(2) |
Nov
(15) |
Dec
(10) |
2009 |
Jan
(8) |
Feb
(3) |
Mar
(2) |
Apr
(8) |
May
(8) |
Jun
(15) |
Jul
(3) |
Aug
(8) |
Sep
(2) |
Oct
(9) |
Nov
(6) |
Dec
(15) |
2010 |
Jan
(2) |
Feb
(9) |
Mar
(1) |
Apr
(5) |
May
(19) |
Jun
(4) |
Jul
(4) |
Aug
(2) |
Sep
(3) |
Oct
(5) |
Nov
|
Dec
(2) |
2011 |
Jan
(5) |
Feb
(2) |
Mar
(1) |
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(3) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(5) |
Jun
(8) |
Jul
(15) |
Aug
|
Sep
|
Oct
(8) |
Nov
(2) |
Dec
(5) |
2013 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(7) |
Aug
(6) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(3) |
Feb
(3) |
Mar
(24) |
Apr
(5) |
May
(1) |
Jun
|
Jul
(7) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: François S. <fsc...@gm...> - 2023-09-20 14:56:39
|
Tom Looking at the documentation, it commits open transactions when the connection is closed (see maxConnectionAge and maxIdleTime ): https://www.mchange.com/projects/c3p0/#autoCommitOnClose If your connections are set by default to auto commit then autoCommitOnClose wont have any effect. Cheers François > On Sep 19, 2023, at 1:47 PM, Tom Johnson <TJo...@mi...> wrote: > > If Connections by default auto commit, what does the pool’s autoCommitOnClose do? I wasn’t setting it to true, but by queries were committed. > Thomas Johnson | Senior Software Engineer www.microautomation.com > O: 703-543-2118 | F: 703-543-2099 | M: 703-424-3153 > 5870 Trinity Parkway, Suite 600, Centreville, VA 20120 > <image001.png> Notice: The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system. > _______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |
From: Tom J. <TJo...@mi...> - 2023-09-20 01:23:17
|
If Connections by default auto commit, what does the pool's autoCommitOnClose do? I wasn't setting it to true, but by queries were committed. Thomas Johnson<mailto:tjo...@mi...> | Senior Software Engineer www.microautomation.com<https://microautomation.com/> O: 703-543-2118 | F: 703-543-2099 | M: 703-424-3153 5870 Trinity Parkway, Suite 600, Centreville, VA 20120<https://www.google.com/maps/place/5870+Trinity+Pkwy+%23600,+Centreville,+VA+20120/@38.8430153,-77.4414592,17z/data=!3m1!4b1!4m5!3m4!1s0x89b644f6d2e8c541:0xf54595a62ba10b32!8m2!3d38.8430153!4d-77.4392705> [cid:image001.png@01D9EB18.FE3EA0C0] Notice: The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system. |
From: François S. <fsc...@gm...> - 2022-12-08 14:51:25
|
Hi Since c3p0 runs on the JVM, you need to look at that when it comes to compatibility requirements, I run it on java 1.8.0_352 on AlmaLinux 8.6 with no issues. Cheers François > On Dec 8, 2022, at 2:09 AM, Prince Sonu (EXT) via c3p0-users <c3p...@li...> wrote: > > Hello Team > Can you Please let me know that c3p0 version 0.9.1.1 is Compatibility with RHEL8.6 or not, if no then Please tell me which version Support RHEL 8.6. > Thanks > Prince Kr Sonu > _______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |
From: Prince S. (EXT) <pri...@er...> - 2022-12-08 14:42:16
|
Hello Team Can you Please let me know that c3p0 version 0.9.1.1 is Compatibility with RHEL8.6 or not, if no then Please tell me which version Support RHEL 8.6. Thanks Prince Kr Sonu |
From: Kelly B. <ken...@gm...> - 2020-01-22 17:09:16
|
I am attempting to use a non-standard method, getServerJobIdentifier(), that is part of the IBM Java Tool Box (jt400.jar). I have tried numerous options but have not stumbled upon the correct parameters to pass. I am using 0.9.5.4. Code snippet follows: // The method I want to call. // getServerJobIdentifier, public abstract java.lang.String com.ibm.as400.access.AS400JDBCConnection.getServerJobIdentifier() String driverClassName = "com.ibm.as400.access.AS400JDBCDriver"; String m_DatabaseConnectionString = "jdbc:db2:*local;naming=sql;extended metadata=true"; Connection m_dbConnection; ComboPooledDataSource m_cpds; m_cpds = new ComboPooledDataSource(); try { m_cpds.setDriverClass(driverClassName); //loads the jdbc driver } catch (Exception e) { e.printStackTrace(); System.exit(0); } m_cpds.setJdbcUrl(m_DatabaseConnectionString); m_dbConnection = m_cpds.getConnection(); String qualifiedName = ""; C3P0ProxyConnection castCon = (C3P0ProxyConnection)m_dbConnection; Method m = AS400JDBCConnection.class.getDeclaredMethod("getServerJobIdentifier"); // This does return what I want. getServerJobIdentified() has no parameters. System.out.println("method=" + m.toString()); Object[] args = new Object[] {}; System.out.println("calling rawConnectionOperation"); qualifiedName = (String) castCon.rawConnectionOperation(m, C3P0ProxyConnection.RAW_CONNECTION, args); // never gets here System.out.println("qualifiedName=" + qualifiedName); I know I'm *that* close or I think I am. Thanks! -- Kelly Beard |
From: Kelly B. <ken...@gm...> - 2019-08-13 16:37:31
|
Presently I like to use one-jar & Gradle in Eclipse. When I run my application, I get log file messages about C3P0 not being able to find all of the supported configuration files. The path seems to be starting from '/'. I prefer to keep config files on the file system and not packed in a jar. I'm using systemctl to run my application as it is a long-running server. Is there an option I can pass to get C3P0 to look outside for it's config? Thanks! -- Kelly Beard |
From: Robert N. <rob...@gm...> - 2018-12-28 04:10:22
|
Is there any version of c3p0 that will support notifying a listener when the preferredTestQuery fails due to SQLException? |
From: Zhou, Y. (N. - CN/Chengdu) <yud...@no...> - 2017-10-13 04:40:03
|
Hi my friends who are using C3P0 * I am writing this mail to request your advice because my project is facing a critical blocker regarding to C3P0 API, we desperately need an advice from the community expert. The jar is c3p0-0.9.1.1 My team is facing a critical issue that 68 threads had been in BLOCKED state, and 67 threads shown following stack trace "FTPCollectionWorker-Thread-1" prio=5 tid=7899 BLOCKED at com.mchange.v2.c3p0.impl.NewProxyConnection.isClosed(NewProxyConnection.java:1279) at com.nsn.oss.mdk.db.utils.LockManager.checkConnection(LockManager.java:377) at com.nsn.oss.mdk.db.utils.LockManager.createLock(LockManager.java:54) Local Variable: java.lang.String#3390213 at com.nsn.oss.mdk.collector.ftp.LockHandler.getLock(LockHandler.java:49) Local Variable: com.nsn.oss.mdk.collector.ftp.LockHandler#38 at com.nsn.oss.mdk.collector.ftp.BaseHelperImpl.lockNotAvailable(BaseHelperImpl.java:578) at com.nsn.oss.mdk.collector.ftp.SFTPHelperImpl.retrieveFiles(SFTPHelperImpl.java:752) Local Variable: java.io.File#2225 Local Variable: java.lang.String#3390214 Local Variable: java.lang.String#2941503 Local Variable: java.util.GregorianCalendar#403870 Local Variable: com.nsn.oss.mdk.collector.ftp.SFTPHelperImpl#5 Local Variable: com.nsn.oss.mdk.collector.ftp.SFTPRemoteFileInfo#67731 Local Variable: com.nsn.oss.mdk.ftp.bookkeeping.BookKeepingUtil#37 Local Variable: java.util.ArrayList#7368 at com.nsn.oss.mdk.collector.ftp.FTPCollectionWorker.collect(FTPCollectionWorker.java:209) at com.nsn.oss.mdk.collector.ftp.BaseCollectionWorker.run(BaseCollectionWorker.java:208) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) Local Variable: java.util.concurrent.ThreadPoolExecutor$Worker#72 Local Variable: java.util.concurrent.ThreadPoolExecutor#50 Local Variable: com.nsn.oss.mdk.collector.ftp.FTPCollectionWorker#37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) and one anther thread shown 1 thread following stack trace "Thread-7" prio=5 tid=25 BLOCKED at oracle.jdbc.driver.PhysicalConnection.prepareCall(PhysicalConnection.java:943) Local Variable: java.lang.String#1896851 at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareCall(NewProxyConnection.java:643) at com.nsn.oss.mdk.db.utils.LockManager.createLock(LockManager.java:56) Local Variable: com.nsn.oss.mdk.db.utils.LockManager#1 Local Variable: java.lang.String#2096395 at com.nsn.oss.mdk.collector.ftp.LockHandler.getLock(LockHandler.java:49) Local Variable: com.nsn.oss.mdk.collector.ftp.LockHandler#24 at com.nsn.oss.mdk.collector.ftp.FTPPUTCollectionWorker$FTPPUTFileAlterationListenerAdaptor.onFileCreate(FTPPUTCollectionWorker.java:407) Local Variable: java.io.File#2189 Local Variable: java.io.File#2188 Local Variable: com.nsn.oss.mdk.collector.ftp.FTPPUTCollectionWorker$FTPPUTFileAlterationListenerAdaptor#5 at com.nsn.oss.mdk.collector.ftp.FileAlterationObserverBasedOnTimeStamp.doCreate(FileAlterationObserverBasedOnTimeStamp.java:232) Local Variable: org.apache.commons.io.monitor.FileEntry#140 at com.nsn.oss.mdk.collector.ftp.FileAlterationObserverBasedOnTimeStamp.checkAndNotify(FileAlterationObserverBasedOnTimeStamp.java:198) Local Variable: org.apache.commons.io.monitor.FileEntry#5 Local Variable: org.apache.commons.io.monitor.FileEntry[]#70 Local Variable: java.io.File[]#16 at com.nsn.oss.mdk.collector.ftp.FileAlterationObserverBasedOnTimeStamp.checkAndNotify(FileAlterationObserverBasedOnTimeStamp.java:68) Local Variable: com.nsn.oss.mdk.collector.ftp.FileAlterationObserverBasedOnTimeStamp#5 at org.apache.commons.io.monitor.FileAlterationMonitor.run(FileAlterationMonitor.java:182) Local Variable: org.apache.commons.io.monitor.FileAlterationMonitor#1 Local Variable: java.util.concurrent.CopyOnWriteArrayList$COWIterator#2 at java.lang.Thread.run(Thread.java:745) The complete dump PFA By comparing the dump with error and correct one, I found following 1. there is only 1 NewProxyConnection instance for each dump, I see there is no huge differences between the two instances 2. for the parent objects, BasicResourcePool intances, one has the field failed_idle_tests with value 24; the correct instance has the same field with value 0. I also checked the source code of the class BasicResourcePool.java, the failed_idle_tests increases while some exceptions happen, does it indicate C3P0 were facing some inner issues at that moment? try { mgr.refurbishIdleResource( resc ); } catch ( Exception e ) { if ( logger.isLoggable( MLevel.FINE ) ) logger.log( MLevel.FINE, "BasicResourcePool: An idle resource is broken and will be purged. [" + resc + ']', e); synchronized (BasicResourcePool.this) { if ( managed.keySet().contains( resc ) ) //resc might have been culled as expired while we tested { removeResource( resc ); ensureMinResources(); } ++failed_idle_tests; setLastIdleCheckFailure(e); } } } [cid:image001.png@01D3441B.AB3AA770] Above are what my team found right now, my team has no idea how to proceed and desperately need support from c3p0 experts. Again, thanks for your support and help. I wish I can receive your valuable support and advice. Thanks! Regards Yuding Developing ISDK Adaptations refers Here<https://sharenet-ims.int.net.nokia.com/Open/558263923> Flash team wiki<https://confluence.int.net.nokia.com/display/IntegrationT/Flash+Team++Portal> It aways seems impossible until it's done! |
From: Leonardo D'A. <le...@gm...> - 2017-08-18 12:36:40
|
Hi everyone, I'm experiencing a weird behaviour with our Java web application, configured to access a PostgreSQL database through C3p0 ComboPooledDataSource. First of all, PostgreSQL server installation has default parameters, we didn't need to change any variable in it.. We run our queries using Spring JdbcTemplate, version 3.2.12.RELEASE. As it is for PostgreSQL, it is configured with default parameters. Here it is our context configuration with C3p0 and Spring; <bean id="resoilDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <!-- access configuration --> <property name="driverClass" value="org.postgresql.Driver" /> <property name="jdbcUrl" value="jdbc:postgresql://localhost:5432/*****" /> <property name="user" value="******" /> <property name="password" value="******" /> <!-- pool sizing --> <property name="initialPoolSize" value="1" /> <property name="minPoolSize" value="1" /> <property name="maxPoolSize" value="6" /> <property name="acquireIncrement" value="3" /> <property name="maxStatements" value="150" /> <!-- refreshing connections --> <property name="maxIdleTime" value="180" /> <!-- 3min --> <property name="maxIdleTimeExcessConnections" value="120" /> <!-- 3min --> <!-- timeouts e testing --> <property name="idleConnectionTestPeriod" value="120" /> <!-- 60 --> <property name="testConnectionOnCheckout" value="true" /> <property name="testConnectionOnCheckin" value="false" /> <property name="preferredTestQuery" value="SELECT 1" /></bean> <bean id="template" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource" ref="resoilDataSource"></property></bean> Let me describe the problem we are encountering: once we reach "maxPoolSize" of idle connections opened on Postgres side, this connections never expires, they remain in "idle" state and there's no way C3p0 will get any of them back for pooling.. I would expect that once one of these opened connections excess idle time, C3p0 is able to reuse it due to the "maxIdleTimeExcessConnections" parameter. Unfortunately, this never happens. I also tried to substitute C3p0 ComboPooledDataSource with Apache DBCP BasicDataSource, but nothing changed. Before using PostgreSQL database for our application, our customers asked us to install our application integrating *other popular databases* instead of PostgreSQL (SQL Server and Oracle in particular) and we never experienced this behaviour. I tried to debug connections using "unreturnedConnectionTimeout" and "debugUnreturnedConnectionStackTraces" but I really cannot find the cause of this situation. Any similar experience or idea would be appreciated, thanks Regards, Leonardo |
From: kevin k. <kev...@gm...> - 2017-06-14 06:20:53
|
Smiles I'd be glad if you added that functionality. For now I have worked around it Have a good day Steve On Wed, Jun 14, 2017 at 1:40 AM, Steve Waldman <swa...@mc...> wrote: > There seems not to be an accessible way to enumerate the named configs > known to the current configuration. Probably there should be. > > smiles, > Steve > > > > On Jun 13, 2017, at 1:02 PM, kevin kirimi <kev...@gm...> > wrote: > > > > Good Day, > > How can I get a list or set of named-config in the xml configuration > file. > > > > Kind regards > > Kimathie > > ------------------------------------------------------------ > ------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot______ > _________________________________________ > > c3p0-users mailing list > > c3p...@li... > > https://lists.sourceforge.net/lists/listinfo/c3p0-users > > |
From: Steve W. <swa...@mc...> - 2017-06-13 22:56:05
|
There seems not to be an accessible way to enumerate the named configs known to the current configuration. Probably there should be. smiles, Steve > On Jun 13, 2017, at 1:02 PM, kevin kirimi <kev...@gm...> wrote: > > Good Day, > How can I get a list or set of named-config in the xml configuration file. > > Kind regards > Kimathie > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |
From: kevin k. <kev...@gm...> - 2017-06-13 20:02:47
|
Good Day, How can I get a list or set of named-config in the xml configuration file. Kind regards Kimathie |
From: Steve W. <swa...@mc...> - 2017-04-26 10:50:30
|
So you can’t do this the way you want, c3p0 won’t let you. It’s very jealous of the process by which it acquires Connections from the database, and explicitly doesn’t let you muck with that, because it wants to ensure its core invariant, that all Connections within a single pool are equivalent and fungible. c3p0 considers two Connections authenticated with different passwords (even if authenticated to the same user) non-identical and not interchangeable. It would insist on segregating them into separate pools. It sounds like your performance issue is that there is some overhead to however you check for the current password. What I would do is poll, in a separate thread, maybe once every 20 seconds. When, infrequently, the password has changed, call setPassword(…) on the DataSource. This would eliminate the overhead of checking the password for every client Connection, in every client’s performance limiting codepath. Good luck! smiles, Steve > On Apr 25, 2017, at 1:37 AM, Lalit Railwani <lal...@gm...> wrote: > > Thanks for your quick response. > > Yes I meant we wrote a subclass of C3P0ConnectionProvider and added code to retrieve pass in the getConnection() method and use that pass to invoke getConnection(user, pass) on the DataSource. > > Regarding invoking setPassword() on the DataSource, we don't know then the password changes so was more looking for hook where the c3p0 pool creates new physical database connection, and invokes the implementation in hook to get the password -- which we can use to provide the password irrespective of whether it has changed or not. > > The problem with doing that in getConnection() is that it is invoked even when there are connections checked out in the pool which is what we are trying to avoid since in our application multiple threads call Hibernate's getSession() which in turn calls getConnection() so we have numerous requests being made to retrieve password even though connections are already present in the pool. So want to be able to change that to retrieve password only when c3p0 makes physical connections to the database. Its like a ConnectionCustomizer before acquiring connections from the database. > > > Regards, > Lalit > > > On Fri, Apr 21, 2017 at 5:54 PM, Steve Waldman <swa...@mc...> wrote: > what do you mean by > >> We did implement the getConnection() method of the Hibernate's ConnectionProvider interface to provide it with the password > > did you write your own ConnectionProvider implementation or subclass C3P0ConnectionProvider? > > basically, the easiest way to occasionally update the password the DataSource uses is just to call setPassword(...) on the DataSource. you should be able to do this via JMX, or if you are customizing the ConnectionProvider you have access to the DataSource (you'll need to cast it to a com.mchange.v2.c3p0.PooledDataSource). > > note that calling getConnection(user, password) on a c3p0 DataSource is fine. c3p0 creates a separate pool for each authentication (user, password pair). > > smiles, > steve > > ~oo~ > Steve Waldman > swa...@mc... > > > On Apr 21, 2017, at 6:10 AM, Lalit Railwani <lal...@gm...> wrote: > >> Hi, >> >> We are using c3p0 version 0.9.2.1 with Hibernate 4.3.10 version and have a scenario where the database password is changed periodically (for security) after the connection pool has been created. >> >> We did implement the getConnection() method of the Hibernate's ConnectionProvider interface to provide it with the password, but that is invoked for every connection request i.e. even to checkout existing connections from the pool and our app being multi threaded the frequency of that is very high and hence not ideal. >> >> So was wondering if there a hook in c3p0 so that it can be provided with a new password to use when its actually creating the physical connection to the database. >> Did have a look at the ConnectionCustomizer stuff but that only has lifecycle method post acquiring the connection. >> >> Is there a pre connection acquire hook or any possible way to only customize behavior to provide c3p0 with new database password only when it makes actual physical connection to the database. >> >> Any help or pointers would be appreciated. Thanks. >> >> >> Regards, >> Lalit >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> _______________________________________________ >> c3p0-users mailing list >> c3p...@li... >> https://lists.sourceforge.net/lists/listinfo/c3p0-users > |
From: Lalit R. <lal...@gm...> - 2017-04-25 08:37:51
|
Thanks for your quick response. Yes I meant we wrote a subclass of C3P0ConnectionProvider and added code to retrieve pass in the getConnection() method and use that pass to invoke getConnection(user, pass) on the DataSource. Regarding invoking setPassword() on the DataSource, we don't know then the password changes so was more looking for hook where the *c3p0 *pool creates new physical database connection, and invokes the implementation in hook to get the password -- which we can use to provide the password irrespective of whether it has changed or not. The problem with doing that in getConnection() is that it is invoked even when there are connections checked out in the pool which is what we are trying to avoid since in our application multiple threads call Hibernate's getSession() which in turn calls getConnection() so we have numerous requests being made to retrieve password even though connections are already present in the pool. So want to be able to change that to retrieve password only when *c3p0 *makes physical connections to the database. Its like a ConnectionCustomizer before acquiring connections from the database. Regards, Lalit On Fri, Apr 21, 2017 at 5:54 PM, Steve Waldman <swa...@mc...> wrote: > what do you mean by > > We did implement the getConnection() method of the Hibernate's > ConnectionProvider interface to provide it with the password > > > did you write your own ConnectionProvider implementation or subclass > C3P0ConnectionProvider? > > basically, the easiest way to occasionally update the password the > DataSource uses is just to call setPassword(...) on the DataSource. you > should be able to do this via JMX, or if you are customizing the > ConnectionProvider you have access to the DataSource (you'll need to cast > it to a com.mchange.v2.c3p0.PooledDataSource). > > note that calling getConnection(user, password) on a c3p0 DataSource is > fine. c3p0 creates a separate pool for each authentication (user, password > pair). > > smiles, > steve > > ~oo~ > Steve Waldman > swa...@mc... > > > On Apr 21, 2017, at 6:10 AM, Lalit Railwani <lal...@gm...> > wrote: > > Hi, > > We are using c3p0 version 0.9.2.1 with Hibernate 4.3.10 version and have a > scenario where the database password is changed periodically (for security) > after the connection pool has been created. > > We did implement the getConnection() method of the Hibernate's > ConnectionProvider interface to provide it with the password, but that is > invoked for every connection request i.e. even to checkout existing > connections from the pool and our app being multi threaded the frequency of > that is very high and hence not ideal. > > So was wondering if there a hook in c3p0 so that it can be provided with a > new password to use when its actually creating the physical connection to > the database. > Did have a look at the ConnectionCustomizer > <http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ConnectionCustomizer.html> > stuff but that only has lifecycle method post acquiring the connection. > > Is there a pre connection acquire hook or any possible way to only > customize behavior to provide c3p0 with new database password only when it > makes actual physical connection to the database. > > Any help or pointers would be appreciated. Thanks. > > > Regards, > Lalit > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > _______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users > > |
From: Steve W. <swa...@mc...> - 2017-04-21 17:11:07
|
what do you mean by > We did implement the getConnection() method of the Hibernate's ConnectionProvider interface to provide it with the password did you write your own ConnectionProvider implementation or subclass C3P0ConnectionProvider? basically, the easiest way to occasionally update the password the DataSource uses is just to call setPassword(...) on the DataSource. you should be able to do this via JMX, or if you are customizing the ConnectionProvider you have access to the DataSource (you'll need to cast it to a com.mchange.v2.c3p0.PooledDataSource). note that calling getConnection(user, password) on a c3p0 DataSource is fine. c3p0 creates a separate pool for each authentication (user, password pair). smiles, steve ~oo~ Steve Waldman swa...@mc... > On Apr 21, 2017, at 6:10 AM, Lalit Railwani <lal...@gm...> wrote: > > Hi, > > We are using c3p0 version 0.9.2.1 with Hibernate 4.3.10 version and have a scenario where the database password is changed periodically (for security) after the connection pool has been created. > > We did implement the getConnection() method of the Hibernate's ConnectionProvider interface to provide it with the password, but that is invoked for every connection request i.e. even to checkout existing connections from the pool and our app being multi threaded the frequency of that is very high and hence not ideal. > > So was wondering if there a hook in c3p0 so that it can be provided with a new password to use when its actually creating the physical connection to the database. > Did have a look at the ConnectionCustomizer stuff but that only has lifecycle method post acquiring the connection. > > Is there a pre connection acquire hook or any possible way to only customize behavior to provide c3p0 with new database password only when it makes actual physical connection to the database. > > Any help or pointers would be appreciated. Thanks. > > > Regards, > Lalit > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |
From: Lalit R. <lal...@gm...> - 2017-04-21 13:10:18
|
Hi, We are using c3p0 version 0.9.2.1 with Hibernate 4.3.10 version and have a scenario where the database password is changed periodically (for security) after the connection pool has been created. We did implement the getConnection() method of the Hibernate's ConnectionProvider interface to provide it with the password, but that is invoked for every connection request i.e. even to checkout existing connections from the pool and our app being multi threaded the frequency of that is very high and hence not ideal. So was wondering if there a hook in c3p0 so that it can be provided with a new password to use when its actually creating the physical connection to the database. Did have a look at the ConnectionCustomizer <http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ConnectionCustomizer.html> stuff but that only has lifecycle method post acquiring the connection. Is there a pre connection acquire hook or any possible way to only customize behavior to provide c3p0 with new database password only when it makes actual physical connection to the database. Any help or pointers would be appreciated. Thanks. Regards, Lalit |
From: Robson S. <ro...@st...> - 2015-09-03 19:12:40
|
Hi guys, I followed the tutorial for installing C3P0 in JBoss AS 7, but I get the following error message: --------------------------------------------------------------------------------------------------------------------------------- S014774: Service status report JBAS014775: New missing/unsatisfied dependencies: service jboss.mbean.service."java:jboss.service=Naming".create (missing) dependents: [service jboss.mbean.service.jboss:server=deaquimicaDS.create] service jboss.mbean.service."java:jboss.service=Naming".start (missing) dependents: [service jboss.mbean.service.jboss:server=deaquimicaDS.start] 15:34:17,796 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back 15:34:17,797 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.mbean.service.jboss:server=deaquimicaDS.createjboss.mbean.service.\"java:jboss.service=Naming\".createMissing[jboss.mbean.service.jboss:server=deaquimicaDS.createjboss.mbean.service.\"java:jboss.service=Naming\".create]","jboss.mbean.service.jboss:server=deaquimicaDS.startjboss.mbean.service.\"java:jboss.service=Naming\".startMissing[jboss.mbean.service.jboss:server=deaquimicaDS.startjboss.mbean.service.\"java:jboss.service=Naming\".start]"]}}} 15:34:17,800 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back 15:34:17,800 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back ------------------------------------------------------------------------------------------------------------------------------------------ OS: Ubuntu 14.04 64 bits JVM: Oracle JDK 1.7.0_80 JBoss: As 7.1.1.Final ------------------------------------------------------- standalone.xml ---------------------------------------------------------- <subsystem xmlns="urn:jboss:domain:ee:1.0"> <global-modules> <module name="com.c3p0" slot="main"/> </global-modules> </subsystem> ------------------------------------------------------------- module.xml ------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="com.c3p0"> <resources> <resource-root path="c3p0-0.9.5.1.jar"/> <resource-root path="c3p0-oracle-thin-extras-0.9.5.1.jar"/> <resource-root path="mchange-commons-java-0.2.10.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> <module name="org.hibernate"/> </dependencies> </module> -------------------------------------------------------------- c3p0.service.xml ------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <!--<!DOCTYPE server>--> <server> <mbean code="com.mchange.v2.c3p0.jboss.C3P0PooledDataSource" name="jboss:server=deaquimicaDS"> <attribute name="JndiName">java:deaquimicaDS</attribute> <attribute name="JdbcUrl">jdbc:firebirdsql:localhost/3050:/opt/firebird/dados/clientes/07/freedom.fdb?lc_ctype=ISO8859_1</attribute> <attribute name="DriverClass">org.firebirdsql.jdbc.FBDriver</attribute> <attribute name="User">sysdba</attribute> <attribute name="Password">123654</attribute> <depends>java:jboss.service=Naming</depends> </mbean> </server> ----------------------------------------------------- Thank's Robson Sanchez Setpoint Tecnologia em Informática Ltda. http://www.stpinf.com (41)3557-5221 - (41)8414-9851 - (41)9136-5869 Freedom-ERP ( http://www.freedom.org.br ) Software Livre de Gestão Empresarial - GPL http://groups.google.com/group/freedomerp Sun Certified Java Programmer (SCJP) Sun Certified Web Component Developer (SCWCD) IBM Certified DB2 UDB Family Fundamentals IBM Certified Lotus Notes Domino 7 System Administration IBM Certified Lotus Notes Domino 7 Application Development |
From: Martin A <wm...@gm...> - 2015-06-24 10:22:52
|
Hello guys, this is my question as posted here: http://stackoverflow.com/questions/31023370/c3p0-datasource-monitor-deadlock-all-threads-hang-how-to-fix We have a Spring based application and recently we went into production. We are using Spring @Controller that ultimately hit DAOs that use JDBCTemplate. It is using c3p0's ComboPooledDataSource On an increased load (something like 150 concurrent users), the application hangs for all users - the DataSource gets locked by something - on a thread dump, there are like 200 threads that say - obviously the DataSource is deadlocked. "http-bio-8080-exec-440" - Thread t@878 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method)- waiting on <146d984e> (a com.mchange.v2.resourcepool.BasicResourcePool) at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:718) After that point the application becomes unusable unless restarted. When this happened DBA guys didn't observe any load on the database. At that time c3p0 was configured like that: app_en.driverClass=com.mysql.jdbc.Driver app_en.user=tapp_en app_en.password=tapp_en app_en.jdbcUrl=jdbc:mysql://10.10.0.102:3306/tapp_en?useUnicode=true&characterEncoding=utf-8&autoReconnect=true app_en.acquireIncrement=5 app_en.maxIdleTime=3600 app_en.maxIdleTimeExcessConnections=300 app_en.unreturnedConnectionTimeout=3600 app_en.numHelperThreads=6 app_en.minPoolSize=20 app_en.maxPoolSize=100 app_en.idleConnectionTestPeriod=120 app_en.testConnectionOnCheckin=true After that, I changed c3p0's configuration as follows - and enabled DEBUG logging for com.mchange.v2.c3p0 package: app_en.driverClass=com.mysql.jdbc.Driver app_en.user=tapp_en app_en.password=tapp_en app_en.jdbcUrl=jdbc:mysql://10.10.0.102:3306/tapp_en? useUnicode=true&characterEncoding=utf-8&autoReconnect=true app_en.acquireIncrement=5 app_en.maxIdleTime=180 app_en.maxIdleTimeExcessConnections=60 app_en.unreturnedConnectionTimeout=30 app_en.checkoutTimeout=10000 app_en.numHelperThreads=12 app_en.debugUnreturnedConnectionStackTraces=true app_en.initialPoolSize=10 app_en.maxPoolSize=100 app_en.idleConnectionTestPeriod=120 app_en.preferredTestQuery="select 1 from tbl_users" With this configuration in place, I again ran load tests and the application still hanged... although the threads recover after they are unable to obtain connection to the database. Even though, the game hanged for too many users even though the threads recovered unlike the previous configuration - so they had to restart their clients. Although all logging was enabled, the c3p0 logs don't log any deadlock messages. The error messages I see are just that: [06/24/2015 12:20:54] [C3P0PooledConnectionPoolManager[identityToken->1oed6dl9a9ak8qsgqfvdu|4d6145af]-HelperThread-#10] DEBUG NewPooledConnection - com.mchange.v2.c3p0.impl.NewPooledConnection@7f0bc55a closed by a client. java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:659) at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:255) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:621) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1024) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) There aren't any transactions in the application made, nor are we using any TransactionManager or TransactionTemplate. I wonder if this may be some kind of bug in the frameworks used, or misconfiguration. These are the relevant frameworks used: c3p0-0.9.5-pre8 mysql-connector-java-5.1.24 spring-core-3.2.1.RELEASE spring-web-3.2.1.RELEASE mchange-commons-java-0.2.7 We really appreciate any help because this is blocking our efforts to release our product. Thank you! |
From: Craig H. <hol...@st...> - 2015-06-03 16:55:33
|
Hi: I am running into persistent issues with connection failures which I have been completely unable to resolve. We are using c3p0 and Hibernate in two JSF web applications where we have concurrent users (130 in one, 20-30 in the other) accessing scientific proposal data in order to review it in a group meeting context. The failures do not exhibit a regular pattern, but are somewhat frequent and seem ot increase with more activity in the application. I have tried repeatedly to adjust the c3p0 parameters yet I am still running into apparently stale/dead connections (errors show below). Hibernate connections are opened at the beginning of the JSF lifecycle and closed at the end of it, so to the best of my understanding there should be no issue where the methods accessing the database should not have connection available to them. Any guidance at all would be appreciated on this. Craig Hollinshead hol...@st... Here is the c3p0 configuration for the application used by reviewers, approx. 130 concurrent users (from hibernate.cfg.xml): <property name="hibernate.c3p0.min_size">20</property> <property name="hibernate.c3p0.max_size">360</property> <property name="hibernate.c3p0.acquire_increment">20</property> <property name="hibernate.c3p0.acquireRetryDelay">3000</property> <property name="hibernate.c3p0.max_statements">100</property> <property name="hibernate.c3p0.timeout">0</property> <property name="hibernate.c3p0.idle_test_period">90</property> <property name="hibernate.c3p0.maxConnectionAge">3600</property> <property name="hibernate.c3p0.maxIdleTimeExcessConnections">1200</property> <property name="hibernate.c3p0.testConnectionOnCheckout">true</property> <property name="hibernate.c3p0.testConnectionOnCheckin">true</property> <property name="hibernate.c3p0.preferredTestQuery">select 1</property> <property name="hibernate.c3p0.numHelperThreads">14</property> The idle test period has been reduced from 360 and test connection parameters both set to true to try and reduce errors; neither has had any effect. I have verified that c3p0 is loaded on startup with the specified parameters. Here are the typical errors: INFO (ProposalReviewController.java:98) 03 Jun 2015 12:20:39 [http-nio-8080-exec-10]: ProposalReviewController:constructor:[pid=25,ppid=607,uid=741] WARN (SqlExceptionHelper.java:144) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: SQL Error: 0, SQLState: 08003 ERROR (SqlExceptionHelper.java:146) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: No operations allowed after connection closed. INFO (DefaultLoadEventListener.java:159) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: HHH000327: Error performing load command : org.hibernate.exception.JDBCConnectionException: could not prepare statement ERROR (UserDAO.java:95) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: get failed org.hibernate.exception.JDBCConnectionException: could not prepare statement at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:65) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:196) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:160) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.prepareQueryStatement(AbstractLoadPlanBasedLoader.java:257) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:201) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:137) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102) at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:186) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4126) at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:503) at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:468) at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:213) at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:275) at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151) at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1070) at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:176) at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2551) at org.hibernate.internal.SessionImpl.get(SessionImpl.java:960) at edu.stsci.model.dao.UserDAO.findById(UserDAO.java:89 ... ... Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1269) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1261) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4246) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4212) at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:546) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) WARN (NewPooledConnection.java:546) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: [c3p0] A PooledConnection that has already signalled a Connection error is still in use! WARN (NewPooledConnection.java:547) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners! com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1269) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1261) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4246) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4212) at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:546) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) WARN (SqlExceptionHelper.java:144) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: SQL Error: 0, SQLState: 08003 ERROR (SqlExceptionHelper.java:146) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: No operations allowed after connection closed. ERROR (UserDAO.java:132) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: find by property name failed org.hibernate.exception.JDBCConnectionException: could not prepare statement at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:65) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:196) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:160) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1885) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1862) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) at org.hibernate.loader.Loader.doQuery(Loader.java:910) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) at org.hibernate.loader.Loader.doList(Loader.java:2554) at org.hibernate.loader.Loader.doList(Loader.java:2540) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370) at org.hibernate.loader.Loader.list(Loader.java:2365) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:497) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103) at edu.stsci.model.dao.UserDAO.findByProperty(UserDAO.java:127) at edu.stsci.model.dao.UserDAO.findByUserid(UserDAO.java:138) ... ... Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1269) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1261) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4246) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4212) at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:546) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) ERROR (Authorization.java:132) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: ERROR: Authorization failed: could not prepare statement WARN (NewPooledConnection.java:546) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: [c3p0] A PooledConnection that has already signalled a Connection error is still in use! WARN (NewPooledConnection.java:547) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners! com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1269) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1261) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4246) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4212) at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:546) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) WARN (SqlExceptionHelper.java:144) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: SQL Error: 0, SQLState: 08003 ERROR (SqlExceptionHelper.java:146) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: No operations allowed after connection closed. ERROR (Authorization.java:392) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: org.hibernate.exception.JDBCConnectionException: could not prepare statement WARN (NewPooledConnection.java:546) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: [c3p0] A PooledConnection that has already signalled a Connection error is still in use! WARN (NewPooledConnection.java:547) 03 Jun 2015 12:20:39 [http-nio-8080-exec-4]: [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners! com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1269) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1261) at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1661) at com.mchange.v2.c3p0.impl.NewProxyConnection.commit(NewProxyConnection.java:1284) at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:112) at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:180) ... ... |
From: Steve W. <swa...@mc...> - 2015-05-12 13:12:25
|
Hi. 1) c3p0 is developed primarily in the US 2) Yes, c3p0 contains plenty of US content 3) c3p0 makes no direct use of encryption, although linked libs (e.g. JDBC drivers) may well. c3p0 is free software provided as-is and without warranty, see the library’s accompanying licenses. That includes the representations above, which are to the best of my knowledge but provided without any sort of guarantee. I wish you the best with your compliance issues, but they are your own. Regards, Steve Waldman > On May 12, 2015, at 5:28 AM, Beurer, Maria (Coriant - DE/Munich) <mar...@co...> wrote: > > Hello, > > We use C3PO JDBCin our commercial product. > > The ECCN is an international Export control and compliance number that is necessary for EVERY Export. Most of the european countries specify their goods according to the european commerce control list (EG dual-use list : http://ec.europa.eu/trade/import-and-ex ... -controls/). > So for Export of a commercial Software using C3PO JDBC( or any other open source or OEM Software), we need to document the libs, on one side to comply with license obligations and on the other side the ECCNs for Export restrictions. Please note, as the US regulations also care about re-export of US items ( any stuff that contains US Content above a certain Limit), we Need to specify both; the EU-ECCN and the US-ECCN and hopefully the US license exception that applies (e.g. TSU for open source). > > So please specify the ECCN for C3PO JDBCor answer the following questions: > - Country of origin ( where is C3PO JDBCSoftware mainly developed) > - is there US Content in there? ( e.g. other open source libs) > - does the Software have encryption capability and if yes, which algorithm(s) are used with which key length > > Thanks and Kind regards > Mit freundlichen Grüßen / Kind Regards / Com os melhores cumprimentos! > Maria Beurer > > <image001.png> > > Coriant GmbH > Maria Beurer > R&D Engineer > Coriant R&D GmbH > SW OSS&Transnet TNTC DE > St.-Martin-Str. 76 > 81541 München > Tel: +49 89 5402 15138 > mar...@co... > http://www.coriant.com > <image002.png>Think before you print > Coriant GmbH > registered under / registriert unter: HRB 202750 | WEEE-Reg.-No. DE 77603797 > Local Court of Munich / Amtsgericht München > Members of the Board / Geschäftsführer: Peter Streit > VAT ID / USt-IdNr.: DE288084869 > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |
From: Beurer, M. (C. - DE/Munich) <mar...@co...> - 2015-05-12 12:44:14
|
Hello, We use C3PO JDBCin our commercial product. The ECCN is an international Export control and compliance number that is necessary for EVERY Export. Most of the european countries specify their goods according to the european commerce control list (EG dual-use list : http://ec.europa.eu/trade/import-and-ex ... -controls/<http://ec.europa.eu/trade/import-and-export-rules/export-from-eu/dual-use-controls/>). So for Export of a commercial Software using C3PO JDBC( or any other open source or OEM Software), we need to document the libs, on one side to comply with license obligations and on the other side the ECCNs for Export restrictions. Please note, as the US regulations also care about re-export of US items ( any stuff that contains US Content above a certain Limit), we Need to specify both; the EU-ECCN and the US-ECCN and hopefully the US license exception that applies (e.g. TSU for open source). So please specify the ECCN for C3PO JDBCor answer the following questions: - Country of origin ( where is C3PO JDBCSoftware mainly developed) - is there US Content in there? ( e.g. other open source libs) - does the Software have encryption capability and if yes, which algorithm(s) are used with which key length Thanks and Kind regards Mit freundlichen Grüßen / Kind Regards / Com os melhores cumprimentos! Maria Beurer [cid:image001.png@01D01091.4F1BD1F0] Coriant GmbH Maria Beurer R&D Engineer Coriant R&D GmbH SW OSS&Transnet TNTC DE St.-Martin-Str. 76 81541 München Tel: +49 89 5402 15138 mar...@co...<mailto:mar...@co...> http://www.coriant.com<mailto:mar...@ns...> [cid:image002.png@01D01091.4F1BD1F0]Think before you print Coriant GmbH registered under / registriert unter: HRB 202750 | WEEE-Reg.-No. DE 77603797 Local Court of Munich / Amtsgericht München Members of the Board / Geschäftsführer: Peter Streit VAT ID / USt-IdNr.: DE288084869 |
From: Steve W. <swa...@mc...> - 2014-08-31 02:53:04
|
hi, currently c3p0’s statement cache does not track cache hit stats. that might be an interesting thing to add, but it’s not there now. smiles, steve On Aug 27, 2014, at 5:48 PM, Philip Zeyliger <ph...@cl...> wrote: > Hi there, > > I'm trying to find cache hit ratios on my statement cache, and I'm having trouble finding the metrics. Do they exist? > > I'm using Hibernate, and I'm seeing from heap dumps that I have lots of queries in the statement cache, with various numbers of ?'s in statements like "SELECT ... FROM ... WHERE id IN (?, ?, ?, ..., ?)" I'm trying to figure out how big of an issue that is. > > Thanks! > > Cheers, > > -- Philip > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/_______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |
From: Philip Z. <ph...@cl...> - 2014-08-27 16:53:53
|
Hi there, I'm trying to find cache hit ratios on my statement cache, and I'm having trouble finding the metrics. Do they exist? I'm using Hibernate, and I'm seeing from heap dumps that I have lots of queries in the statement cache, with various numbers of ?'s in statements like "SELECT ... FROM ... WHERE id IN (?, ?, ?, ..., ?)" I'm trying to figure out how big of an issue that is. Thanks! Cheers, -- Philip |
From: Simon K. <ku...@fl...> - 2014-07-31 09:21:23
|
Hi, I did a small test to see how our server using c3p0 reacts in case the database is not reachable any more. For this test I am continuing to send some requests to our server (running in tomcat) where we try to do some database operations. During the test I plug the network cable so the database can not be reached. After some time I noticed that some threads seem to be stuck, so I took a look into it using jconsole. I see that several threads that are waiting on this point: Name: http-nio-8080-exec-28 State: WAITING on com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache@2d5e7346 Total blocked: 138 Total waited: 98 Stack trace: java.lang.Object.wait(Native Method) java.lang.Object.wait(Object.java:503) com.mchange.v2.c3p0.stmt.GooGooStatementCache.acquireStatement(GooGooStatementCache.java:552) com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkoutStatement(GooGooStatementCache.java:168) com.mchange.v2.c3p0.impl.NewPooledConnection.checkoutStatement(NewPooledConnection.java:234) - locked com.mchange.v2.c3p0.impl.NewPooledConnection@f932b3f com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:199) - locked com.mchange.v2.c3p0.impl.NewProxyConnection@4e1b56a sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) com.sun.proxy.$Proxy92.prepareStatement(Unknown Source) org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147) org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166) org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145) org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1711) ... My question is: What is the relevant timeout at this point? I tried 'checkoutTimeout', but it does to seem to have any effect at this point. Regards, Simon Kulessa |
From: Simon K. <ku...@fl...> - 2014-07-24 14:59:16
|
Hi Steve, I am no oracle expert myself and I do not know whether a high number of logon's need considerably more memory (or performance) than a high number of active connections. But this is the complain I get. For me it seems that it's indeed the churn that hurts, not the large pool size. So configuring maxIdleTimeExcessConnections would do more damage than good. Regards, Simon Am 22.07.2014 13:05, schrieb Steve Waldman: > p.s. i would still try acquireIncrement of 1. it might help more than you think, because it permits checkins to prevent acquisition attempts that would otherwise occur. if the pool is empty but below maxPoolSize and there is a single attempt made, with acquireIncrement of 4, 4 Connections will be acquired, even if by the time the next client comes, other Connections have been checked in and made available. with acquireIncrement of 1, the pool’s expansion will be blocked by intervening checkins. > > another parameter you might use is maxIdleTimeExcessConnections, set to a (short) value that causes the pool to aggressively contract. again, this won’t help with pacing (and if it’s churn that hurts your server, it might hurt), but it will reduce the likelihood that the pool is or stays at the large sizes at which you are probably observing problems. > > > On Jul 22, 2014, at 1:57 PM, Simon Kulessa <ku...@fl...> wrote: > >> Hi, >> >> thanks for the answer. >> The currently configured value for acquireIncrement is 4 - bringing this down to 1 will probably not have any noticeable impact. >> >> Are there any plans to implement a feature like this? >> >> Regards, >> Simon Kulessa >> >> Am 22.07.2014 12:30, schrieb Steve Waldman: >>> alas, there is not for now a way to specify a delay between Connection acquisition attempts. >>> >>> one thing you could do is something i generally disrecommend: set acquireIncrement to 1. usually this is a bad idea, as it means that while the pool expands, some client must wait for each Connection acquisition. to minimize the number of clients that experience the latency of Connection acquisition, letting pressure trigger multiple “prefetched” acquisitions is usually the way to go. >>> >>> but if you prefer that clients experience a bit of latency than very rapid demand for Connections on the server side (which it seems clear that you do), acquireIncrement of 1 may help, a little. >>> >>> still, there’s no way to slow c3p0’s attempts to acquire new Connections to a pace slower than actual client demand. we’d have to add an explicit delay to make that happen. >>> >>> smiles, >>> steve >>> >>> >>> >>> >>> On Jul 22, 2014, at 11:33 AM, Simon Kulessa <ku...@fl...> wrote: >>> >>>> Hi, >>>> >>>> is there a way to tell c3p0 to delay the acquisition of new database >>>> connections? >>>> >>>> Basically if our Server comes under load and the number of needed >>>> database connections goes >>>> up from 10 to 1000, c3p0 requests all these database connections in a >>>> very short interval of time. >>>> >>>> Apparently on an oracle database a logon consumes around 2 MB, so >>>> requesting a large number >>>> of new connections requires a lot of memory on database size. The >>>> problem is that this much memory >>>> might not be available at once and causes problems of the performance of >>>> the database server. >>>> >>>> So I am looking for a way to limit the amount of new connections that >>>> can be acquired in a certain interval of time. >>>> I don't see any matching parameters that could be used. >>>> >>>> c3p0 and hibernate version is 4.1.4.Final. >>>> >>>> Regards, >>>> Simon Kulessa >>>> >>>> ------------------------------------------------------------------------------ >>>> Want fast and easy access to all the code in your enterprise? Index and >>>> search up to 200,000 lines of code with a free copy of Black Duck >>>> Code Sight - the same software that powers the world's largest code >>>> search on Ohloh, the Black Duck Open Hub! Try it now. >>>> http://p.sf.net/sfu/bds >>>> _______________________________________________ >>>> c3p0-users mailing list >>>> c3p...@li... >>>> https://lists.sourceforge.net/lists/listinfo/c3p0-users > |