c3p0

Do I need to use C3P0 pooling library in my (grails) web application?

霸气de小男生 提交于 2019-12-06 06:06:14
I am not familiar at all with connection pooling library. I've just discovered it through this blog article ) and I am not sure that I should use one in my web application based on grails/hibernate/mysql. So my question is simple : in which situations would you suggest to integrate a connection pooling library into a grails application? Always, Never or only over some connections threshold? P.S. : If you have ever used successfully C3P0 in your web application, I will greatly appreciate to hear your feedback (in terms of visible positive effects). Regardless of which pooling implementation,

Is c3p0 connection pool is required with hibernate in JBoss AS 7

核能气质少年 提交于 2019-12-06 00:14:48
My project is in the beginning stage and I am having a big issue with hibernate. I am using hibernate 4.1.8-Final with c3p0 0.9.1.2. I have the following entity class: @javax.persistence.Entity @Table(name = "CUSTOMER") public class Customer extends Entity { @Transient private static final long serialVersionUID = 3326144323537452197L; private String customerId; private String customerName; private boolean active; public Customer() { super(); } @NaturalId @Column(name = "CUSTOMER_ID", nullable = false) public String getCustomerId() { return customerId; } public void setCustomerId(String

C3p0 with Hibernate 4.2 error: setCharacterStream(ILjava/io/Reader;J)V is abstract

吃可爱长大的小学妹 提交于 2019-12-05 18:39:40
I am using Hibernate 4.2 with c3p0 and I am getting this error: Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V is abstract Anybody knows which version should I use? Here is my current Maven dependencies list: <dependency> <groupId>com.mchange</groupId> <artifactId>c3p0</artifactId> <version>0.9.2</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-c3p0</artifactId> <version>4.2.0.Final</version> </dependency> The PreparedStatement.setCharacterStream() method was added to JDBC 4 and according to C3P0

Connection hanging occasionally with Amazon RDS MySQL & Play Framework 1.2.5 (c3p0 default settings)

不羁的心 提交于 2019-12-05 17:28:00
We're having problems with Amazon-hosted Play application with RDS Mysql . Sometimes the application ends up unresponsive. Today I checked the thread status with jstack -F and there were multiple threads stuck in native code for c3p0 connection : Thread 14060: (state = IN_NATIVE) - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise) - java.net.SocketInputStream.read(byte[], int, int, int) @bci=79, line=150 (Compiled frame) - java.net.SocketInputStream.read(byte[], int, int) @bci=11, line=121 (Compiled frame

Hibernate/c3p0 connection leak

风格不统一 提交于 2019-12-05 17:16:29
问题 We're running a spring/hibernate/c3p0 application under load. When I reduce the c3p0 maxPoolSize to some far, far lower than the number of concurrent users, our application just hangs. There are no error messages in the log, but it doesn't proceed forward either. I expect the application to slow down, but not to stop altogether. Here is our c3p0 configuration: <bean id="coreDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverClass="${core.jdbc.driver}"

Is C3P0 thread-safe?

泪湿孤枕 提交于 2019-12-05 14:36:08
问题 An interruption exception (java.lang.InterruptedException) occurs as I'm trying to perform some simple read (SELECT) operations using C3P0 on a MySQL database. The exception occurs as I increase the number of parallel threads more than 100 (I have tried with 5,10,20,60 and 100). The statement I execute is as simple as : SELECT `Model.id` FROM `Model` LIMIT 100; My connections are pooled from a ComboPooledDataSource which is configured using the following properties (see also the C3P0 manual):

C3P0: unreturnedConnectionTimeout in production?

这一生的挚爱 提交于 2019-12-05 11:27:23
The parameter unreturnedConnectionTimeout times out unreturned connections after a given period of time. I'm trying to decide whether I should use this in my production persistence.xml ? A big plus of using this is that the Connection Pool will be able to recover from leaky connections. A big minus is that leaky connections will be very difficult to detect. Should I use unreturnedConnectionTimeout in production applications? If yes, what should its value be? Are there any other pros/cons I should consider? Steve Waldman You should debug your Connection leaks, and then not use

APPARENT DEADLOCK c3p0 0.9.5.1 spring

让人想犯罪 __ 提交于 2019-12-05 11:22:18
We are facing APPARENT DEADLOCK while using c3p0 0.9.5.1 ( which is latest version of c3p0). following is the connection pool config we are using. p:driverClass="${app.jdbc.driverClassReplica}" p:jdbcUrl="jdbc:mysql://database,database/dbname" p:acquireIncrement="5" p:idleConnectionTestPeriod="300" p:maxPoolSize="100" p:maxStatements="2000" p:minPoolSize="10" p:maxIdleTime="1800" p:maxConnectionAge="3600" p:maxIdleTimeExcessConnections="20" p:numHelperThreads="15" p:preferredTestQuery="SELECT 1"/> and Following are the logs ThreadPoolAsynchronousRunner:743---- com.mchange.v2.async

MySQL Hibernate connection issue while using c3p0

徘徊边缘 提交于 2019-12-05 07:42:39
问题 I have a web application developed with struts 1.3, Hibernate3 and Spring security. The application was previously dead after 8 hours since MySQL closed the connection after the time. Then i collect the information from several posts to keep it alive for much long now it is almost 20 - 24 hour. Can any body help me out to make this thing working. Summary Iam unable to login after 20 hours of inactivity. Connection is closed by MySQL. Thanks. Please find the below snippets for the

C3P0 APPARENT DEADLOCK when my tomcat startup

不问归期 提交于 2019-12-05 07:23:56
when I start up my project by tomcat or resin,my project will throw the error: APPARENT DEADLOCK I think the error caused by c3p0 can't connect my database, I change my xml and replace the domain name by ip of my database, and then the project start up! I use a listener before my c3p0 working ,and I can get the correct domain name and ip,I can't find the reason of APPARENT DEADLOCK. 012-10-22 16:53:04 24344 WARN [Timer-0] com.mchange.v2.async.ThreadPoolAsynchronousRunner:624 - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1e79aa -- APPARENT DEADLOCK!!! Complete Status: