connection-pooling

Tomcat Connection pool : few methods not releasing connection

守給你的承諾、 提交于 2019-12-31 03:02:22
问题 I am using tomcat connection pooling. But I was following exception org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object So I put in the following lines in context.xml to find the leak : removeAbandoned="true" logAbandoned="true" removeAbandonedTimeout="3" Then I started getting following exception org.apache.tomcat.dbcp.dbcp.AbandonedTrace$AbandonedObjectException: DBCP object created 2015-01-17 22:12:18 by the following code was

Connection pool issue

丶灬走出姿态 提交于 2019-12-30 10:44:20
问题 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

Scala connection pool library?

落花浮王杯 提交于 2019-12-30 09:56:09
问题 I'm trying to use Squeryl in a new Scala project. This is my first project in Scala, so I'm looking for a good Scala library to handle connection pooling. Of course I might as well use a Java library. What would be a best fit for SQueryl? Amongst java libraries I'm considering DBCP, C3P0, Proxool and BoneCP, being BoneCP a serious candidate looking at their benchmarks. 回答1: I've used C3P0 in production for many years, always been rock solid for me. Watch out with your DB driver tho, they can

Prepared Statements along with Connection Pooling

元气小坏坏 提交于 2019-12-30 06:21:08
问题 I have a question regarding general use of Prepared Statement along with connection pooling. Prepared Statements are generally tied to one connection only.In our application, a PreparedStatement is created at the start up and executed at a later point. If at the time of execution of some specific prepared statement, connection associated with the prepared statement is busy executing other statements than how this required statement will get executed.Does this statement will wait for

Does c3p0 connection pooling ensures max pool size?

放肆的年华 提交于 2019-12-30 04:45:09
问题 I've gone through several question, this is somewhat related but doesn't answer my question. Does the c3p0 connection pooling maxPoolSize ensures that the number of connections at a certain time never exceeds this limit? What if the maxPoolSize=5 and 10 users start using the app exactly at the same time? My app. configurations <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"><value>${database.driverClassName}</value>

Using BoneCP: Handling connections from the pool

此生再无相见时 提交于 2019-12-30 03:19:06
问题 I have just started using BoneCP and this is my first time using a connection pool. I'm somewhat confused as to how I am supposed to use it. Currently I am saving the BoneCP-object as a static variable, and thus I can use it between different connections. When I'm done with the connection, I close it with connection.close() . Should I do this, or should I not close it to enable it to be reused by the pool? This is my current implementation to get a connection: private static BoneCP

.NET, the SqlConnection object, and multi-threading

[亡魂溺海] 提交于 2019-12-29 07:32:25
问题 We have an application which uses an SQL Server 2008 R2 database. Within the application, calls to the database are made using a SqlConnection object. This SqlConnection object is initialized once, the first time it is accessed, and then re-used throughout the application. The action that we use is the following: Protected _cn As SqlConnection = Nothing ... Protected Sub Open() If _cn Is Nothing Then _cn = New SqlConnection(_sqlConn) End If If _cn.State = ConnectionState.Closed OrElse _cn

.NET, the SqlConnection object, and multi-threading

拈花ヽ惹草 提交于 2019-12-29 07:31:11
问题 We have an application which uses an SQL Server 2008 R2 database. Within the application, calls to the database are made using a SqlConnection object. This SqlConnection object is initialized once, the first time it is accessed, and then re-used throughout the application. The action that we use is the following: Protected _cn As SqlConnection = Nothing ... Protected Sub Open() If _cn Is Nothing Then _cn = New SqlConnection(_sqlConn) End If If _cn.State = ConnectionState.Closed OrElse _cn

Configure SQL Server connection pool on Tomcat

孤者浪人 提交于 2019-12-29 04:59:15
问题 I've been trying to configure a connection pool for a SQL Server 2012 database. I currently have Informix and Oracle pools configured and working, only SQL Server is giving me a headache. This is how my resource on Context.xml looks so far: <Resource name="jdbc/sqlserv" auth="Container" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" type="javax.sql.DataSource" maxActive="50" maxIdle="10" maxWait="15000" username=

C3P0 apparent deadlock when the threads are all empty?

北战南征 提交于 2019-12-29 03:52:08
问题 I'm using C3P0 as a connection pool in Tomcat, and I'm seeing very worrying errors: 2010-09-16 13:25:00,160 [Timer-0] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@43502400 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! 2010-09-16 13:25:01,407 [Timer-0] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector