connection-pooling

how to configure (spring) JMS connection Pool for WMQ

十年热恋 提交于 2019-12-04 02:17:59
问题 I am trying to configure a JMS connection pool in spring/camel for Websphere MQ. I am seeing class cast exception, when tried to use CachingConnectionFactory from spring. Could not find a pool from WMQ, have anybody done connection pooling with WMQ, i didnt find any examples. There are lot of examples for ActiveMQ. here is what i have so far, that is producing class cast exception. <bean id="inCachingConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">

Deadlocks causing 'Server failed to resume the transaction' with NHibernate and distributed transactions

烂漫一生 提交于 2019-12-04 01:50:02
We are having an issue when using NHibernate with distributed transactions. Consider the following snippet: // // There is already an ambient distributed transaction // using(var scope = new TransactionScope()) { using(var session = _sessionFactory.OpenSession()) using(session.BeginTransaction()) { using(var cmd = new SqlCommand(_simpleUpdateQuery, (SqlConnection)session.Connection)) { cmd.ExecuteNonQuery(); } session.Save(new SomeEntity()); session.Transaction.Commit(); } scope.Complete(); } Sometimes, when the server is under extreme load, we'll see the following: The query executed with cmd

how to choose maximum connection pool size?

寵の児 提交于 2019-12-04 01:44:30
问题 <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? 回答1: 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

Long lasting 'COMMIT' queries with 'idle' state in pg_stat_activity

点点圈 提交于 2019-12-04 00:48:26
If I query: select * from pg_stat_activity where application_name ~ 'example-application'; I get many rows which state is idle and query is COMMIT . They are long lasting and do not disappear. After some time, my application reach hibernate.c3p0.max_size (maximum number of JDBC connections in the pool) limit and stops working with database. Some application implementation details are described in other SO thread: Guice DAO Provider in thread pool - queries become 'idle in transation' Why does it happen? How to solve this problem? If the session is "idle" the query column shows the last

Database connection pooling with multi-threaded service

落花浮王杯 提交于 2019-12-04 00:32:36
问题 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,

Why aren't connections being reused in my iSeries/ASP.NET MVC 4 app?

对着背影说爱祢 提交于 2019-12-03 23:45:56
We are running an MVC 4 web application on a Windows 2008 server farm. We have been trying to upgrade our server farm to Windows 2008 R2 64-bit servers but have run into an issue with connection pooling on an iSeries (running V7R1). We frequently call DB2 java stored procedures and have enabled connection pooling to reduce the time it takes to establish connections. Below is an example of the connection string we’re using. <add name="DB2" connectionString="ConnectionTimeout=45;Pooling=true;MinimumPoolSize=1;MaximumPoolSize=-1;MaximumUseCount=100;CheckConnectionOnOpen=true;DataSource=XXX;Naming

How to get detailed list of connections to database in sql server 2005?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 22:36:14
How to get detailed list of connections to database in sql server 2005? Use the system stored procedure sp_who2 . Hutch sp_who2 will actually provide a list of connections for the database server , not a database . To view connections for a single database (YourDatabaseName in this example), you can use DECLARE @AllConnections TABLE( SPID INT, Status VARCHAR(MAX), LOGIN VARCHAR(MAX), HostName VARCHAR(MAX), BlkBy VARCHAR(MAX), DBName VARCHAR(MAX), Command VARCHAR(MAX), CPUTime INT, DiskIO INT, LastBatch VARCHAR(MAX), ProgramName VARCHAR(MAX), SPID_1 INT, REQUESTID INT ) INSERT INTO

Zombie Connections to MySQL using c3p0 with tomcat

感情迁移 提交于 2019-12-03 21:06:23
I'm using c3p0 to manage my Database Connections to MySQL. The problem is that some connections are being hold forever. I have a limit of 1000 connections, but for some unknown reason, there are 1200 open connections. To investigate it, I do this command in the tomcat server shell: netstat -n |grep 3306|grep ESTABILISHED|wc -l and it returns 1200 here is the c3p0 configuration in context.xml <Resource name="jdbc/xxxx" auth="Container" user="xxxxxx" password="xxxxx" driverClass="com.mysql.jdbc.Driver" jdbcUrl ="jdbc:mysql://xxxx:3306/xxx" factory="org.apache.naming.factory.BeanFactory" type=

Tomcat connection pooling with prepared statement cache

百般思念 提交于 2019-12-03 20:14:35
Having upgraded from DBCP connection pooling to Tomcat's own implementation (based on the excellent comparison here ); I'm a little confused as to why they've dropped these 2 properties, while keeping everything else: poolPreparedStatements="true" maxOpenPreparedStatements="10000" Does this mean that prepared statement pooling is not supported in this implementation? And does each connection maintain its own pool of prepared statements by default? I've spent a considerable time researching this and have found no clear answer! Thanks for your time. Tomcat's (fairly) new jdbc-pool does have a

spring/tomcat-jdbc pool - new connection listener

最后都变了- 提交于 2019-12-03 18:00:33
I am using tomcat-jdbc pool in default spring-boot setup. I would like to run some custom Java code each time new JDBC connection is established in the pool and before it is used for the first time. How to do it, and if there are several possibilities which one is the best? Well, I can think of two options: Create your own wrapper class - either by extending Tomcat's DataSource class or by implementing Java's DataSource interface and delegating to the wrapped DataSource - and then add the logic you want to the desired methods and register a bean in a @Configuration class by manually