connection-pooling

how to choose maximum connection pool size?

ぃ、小莉子 提交于 2019-12-01 08:51:38
<property name="hibernateProperties"> <props> <prop key="hibernate.c3p0.max_size">?</prop> </props> </property> is it just a random number guess ? or are there any studies that suggest to use a particular range for a specific use case? Well, assuming that you are talking about a production system, then "random number guess" is definitely not the answer. Actually, "random number guess" is never the answer for any sort of configuration in a production environment. Same goes for "just accepting the product's defaults". Connection pool properties (such as max_size ) depend on a few factors:

How do I configure c3p0 for a grails 2.X application with multiple datasources?

情到浓时终转凉″ 提交于 2019-12-01 08:24:33
I'm trying to find an easy-to-follow solution (possibly an answer to this question) for configuring c3p0 connection pooling on a grails 2.X web app with multiple datasources. I have not been able to find any clear and easy help via google searching. The answer I'm looking for will say the following: 1) What jars are needed 2) What grails files need to be modified 3) Examples of what to put in these grails files including import statements and example code. Assume I have two datasources in my app, dataSource and dataSource_A configured in DataSource.groovy. How do I configure c3p0 connection

Connection pool issue

◇◆丶佛笑我妖孽 提交于 2019-12-01 08:07:46
If I launch my application after it was idle for some time, I used to get below error. ( I am using Spring+Hibernate+MySQL as DB ) ERROR [org.hibernate.util.JDBCExceptionReporter]The last packet successfully received from the server was 74,188,684 milliseconds ago. The last packet sent successfully to the server was 74,188,685 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J

How do I configure c3p0 for a grails 2.X application with multiple datasources?

有些话、适合烂在心里 提交于 2019-12-01 07:18:42
问题 I'm trying to find an easy-to-follow solution (possibly an answer to this question) for configuring c3p0 connection pooling on a grails 2.X web app with multiple datasources. I have not been able to find any clear and easy help via google searching. The answer I'm looking for will say the following: 1) What jars are needed 2) What grails files need to be modified 3) Examples of what to put in these grails files including import statements and example code. Assume I have two datasources in my

Java Connection Pooling

混江龙づ霸主 提交于 2019-12-01 06:35:15
I searched for connection pooling and read about it. If I understand it correctly, a connection pool is like a collection of open connections. If a connection is established or created it should be added to the connection pool, and if that connection is closed it should be removed in connection pool; while it is open I can use it again and again. While reading these tutorials and explanations about connection pooling I have some questions: Can a pool of connections only be used on a certain computer? Like ComputerA cannot share its connection pool with ComputerB? Where should connection.close(

Database connection pool[Hikari] initialize error

元气小坏坏 提交于 2019-12-01 05:27:35
问题 I am trying to configure HikariCP for my web application. I am not using any frameworks, it is a plain simple java web app. When I tried to establish a connection through normal JDBC it was successful and I was able to perform all database operations. However, when I am trying to get a connection with a connection pool, I get an exception after initialization which I have no clue about. Below is the config that I am using, I am initializing it in a context listener. I am running on Java 1.7,

Tomcat Connection Pool Exhausted

血红的双手。 提交于 2019-12-01 04:18:24
I'm using Apache Tomcat JDBC connection pooling in my project. I'm confused because under heavy load I keep seeing the following error: 12:26:36,410 ERROR [] (http-/XX.XXX.XXX.X:XXXXX-X) org.apache.tomcat.jdbc.pool.PoolExhaustedException: [http-/XX.XXX.XXX.X:XXXXX-X] Timeout: Pool empty. Unable to fetch a connection in 10 seconds, none available[size:4; busy:4; idle:0; lastwait:10000]. 12:26:36,411 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/APP].[AppConf]] (http-/XX.XXX.XXX.X:XXXXX-X) JBWEB000236: Servlet.service() for servlet AppConf threw exception: org.jboss

Database connection pooling with multi-threaded service

喜你入骨 提交于 2019-12-01 03:37:56
I have a .NET 4 C# service that is using the TPL libraries for threading. We recently switched it to also use connection pooling, since one connection was becoming a bottle neck for processing. Previously, we were using a lock clause to control thread safety on the connection object. As work would back up, the queue would exist as tasks, and many threads (tasks) would be waiting on the lock clause. Now, in most scenarios, threads wait on database IO and work processes MUCH faster. However, now that I'm using connection pooling, we have a new issue. Once the max number of connections is reached

Java Connection Pooling

微笑、不失礼 提交于 2019-12-01 03:35:57
问题 I searched for connection pooling and read about it. If I understand it correctly, a connection pool is like a collection of open connections. If a connection is established or created it should be added to the connection pool, and if that connection is closed it should be removed in connection pool; while it is open I can use it again and again. While reading these tutorials and explanations about connection pooling I have some questions: Can a pool of connections only be used on a certain

C3P0 Configurations! Where and How?

╄→гoц情女王★ 提交于 2019-12-01 03:26:21
We are implementing a Web App using JPA2.0 and Hibernate3.0. Connection pool configurations are set in persistence.xml located in META-INF folder. persistence.xml: <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL"> <!-- Entity Classes--> <properties> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/> <property name="hibernate.show_sql" value="true"/> <property name="bytecode.provider"