connection-pooling

Basics - Troubleshooting Hibernate / JDBC Connection Pool Issue

ε祈祈猫儿з 提交于 2019-12-09 08:08:52
问题 What is Hibernate's responsibility in regards to database connections it gets from an underlying connection pool. Does it test to see if a connection is closed before it uses it? and if so get another connection from the pool? I've included error and confirmation info below. Any ideas of where I can start to troubleshoot this would be very helpful. And any advice on the SQL Server driver settings we are using. from the Catalina log: 04-Nov-2010 21:54:52.691 WARNING org.apache.tomcat.jdbc.pool

JBOSS AS 7.1.1.Final Closing Leaked Connections?

扶醉桌前 提交于 2019-12-09 07:11:31
问题 I have already done the following settings in standalone.xml as: <datasource jta="true" jndi-name="java:jboss/datasources/myDS" pool-name="java:jboss/datasources/myDS" enabled="true" use-ccm="true"> <cached-connection-manager debug="true" error="true"/> Therefore, I am also getting the messages like "Closing a connection for you" as: INFO [org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager] (http--0.0.0.0-8080-160) IJ000100: Closing a connection for you. Please close them

How to get number of unused/used connection in nodejs mysql connection pool?

六眼飞鱼酱① 提交于 2019-12-09 05:42:30
问题 I am using nodejs connection pooling, with npm's "mysql" module. While creating a pool I have specified the connectionLimit as 100. I would like to know how many of my connections are used/unused from the pool at runtime. 回答1: By looking at the source code here, it appears that you can look at: pool.config.connectionLimit // passed in max size of the pool pool._freeConnections.length // number of free connections awaiting use pool._allConnections.length // number of connections currently

c3p0 pool is not shrinking

感情迁移 提交于 2019-12-08 23:18:20
I am using c3p0 connection pool with Spring (with plain jdbc, no hibernate). Here is my configuration for pool <bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${jdbc.driver}"/> <property name="jdbcUrl" value="${jdbc.url}"/> <property name="user" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> <property name="acquireIncrement" value="3"/> <property name="minPoolSize" value="3"/> <property name="maxPoolSize" value="25"/> <property name="maxStatementsPerConnection" value="0"/>

How to find leaking db connection pool handle?

我只是一个虾纸丫 提交于 2019-12-08 22:52:48
问题 I'm seeing the dreaded "The timeout period elapsed prior to obtaining a connection from the pool" error. I've searched the code for any unclosed db connections, but couldn't find any. What I want to do is this: the next time we get this error, have the system dump a list of which procs or http requests are holding all the handles, so I can figure out which code is causing the problem. Even better would be to see how long those handles had been held, so I could spot used-but-unclosed

Spark connection pooling - Is this the right approach

本秂侑毒 提交于 2019-12-08 19:13:30
I have a Spark job in Structured Streaming that consumes data from Kafka and saves it to InfluxDB. I have implemented the connection pooling mechanism as follows: object InfluxConnectionPool { val queue = new LinkedBlockingQueue[InfluxDB]() def initialize(database: String): Unit = { while (!isConnectionPoolFull) { queue.put(createNewConnection(database)) } } private def isConnectionPoolFull: Boolean = { val MAX_POOL_SIZE = 1000 if (queue.size < MAX_POOL_SIZE) false else true } def getConnectionFromPool: InfluxDB = { if (queue.size > 0) { val connection = queue.take() connection } else { System

Execution Time Slower with each Iteration of the same SPROC

馋奶兔 提交于 2019-12-08 17:30:44
问题 Running the same Stored Procedure from C# .Net application over a network gets progressively slower with each subsequent execution. It appears to take twice the amount of time as the previous execution (up to a max value; read on). The execution time becomes progressively slower until 1 of 2 scenarios happens, at which point the first execution of the SPROC is "fast" again. If an SqlConnection is opened and remains open during all testing, the SPROC gets progressively slower until any other

C#, Dapper, SQL Server and Connection Pooling

喜你入骨 提交于 2019-12-08 16:38:54
问题 I've written some code to write some data to SQL Server, using Dapper. I don't need to wait for this write to complete before continuing other work, so want to use Task.Run() to make this asynchronous. I have (using) statements for calling this in the rest of my system: using (IDataAccess ida = new DAL()) { ida.WriteMessageToDB(id, routingKey, msgBody); } My DAL will automatically check the dbConnection.State when the using statement is ran, and attempt a simple fix if it's closed. This works

How to pool the connections of mongodb with casbah?

筅森魡賤 提交于 2019-12-08 15:27:23
问题 I'm using mongodb with scala driver casbah . If I'm not understanding wrong, it doesn't provide connection pool. Is there any pool libraries for casbah, like dbcp / c3p0 for jdbc connections? 回答1: Casbah wraps the MongoDB Java Driver which provides a connection pool. An Instance of MongoConnection is actually an instance of the pool, not an individual connection. The pool can be tuned with an instance of the MongoOptions class passed to a new MongoConnection. 来源: https://stackoverflow.com

Unable to get JDBC connection but only 10% of available connections are being used

送分小仙女□ 提交于 2019-12-08 13:15:18
问题 Here is exception I am getting This is the configuration I am using in my c3p0 <property name="acquireIncrement">5</property> <property name="preferredTestQuery">SELECT 1</property> <property name="checkoutTimeout">2000</property> <property name="idleConnectionTestPeriod">30</property> <property name="initialPoolSize">5</property> <property name="maxIdleTime">18000</property> <property name="maxPoolSize">500</property> <property name="minPoolSize">5</property> <property name="maxStatements"