connection-pooling

hibernate c3p0 broken pipe

余生颓废 提交于 2019-12-04 20:30:28
I'm using hibernate 3 with c3p0 for a program which constantly extracts data from some source and writes it to a database. Now the problem is, that the database might become unavailable for some reasons (in the simplest case: i simply shut it down). If anything is about to be written to the database there should not be any exception - the query should wait for all eternity until the database becomes available again. If I'm not mistaken this is one of the things the connection pool could do for me: if there is a problem with the db, just retry to connect - in the worst case for infinity. But

TransactionScope helper that exhausts connection pool without fail - help?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 20:10:10
问题 A while back I asked a question about TransactionScope escalating to MSDTC when I wasn't expecting it to. (Previous question) What it boiled down to was, in SQL2005, in order to use a TransactionScope, you can only instance and open a single SqlConnection within the life of the TransactionScope. With SQL2008, you can instance multiple SqlConnections, but only a single one can be open at any given time. SQL2000 will always escalate to DTC...we don't support SQL2000 in our application, a

Connection pooling in Swing based Application

断了今生、忘了曾经 提交于 2019-12-04 19:49:58
I have one application in Java Swing. In which i have used one connection for the application on single database. But now multiple users are usig that application , so everytime new connection is getting created. DB is coming very slow in performance; Can I use connection pooling in Swing based desktop based application. DB used is SQL server 2000. Any help appriciated. Thanx in advance. Yes you can use C3P0 There are many connection pooling libraries in fact. anvarik http://commons.apache.org/pool/ might be also helpful. I actually had the same question for CouchDB here: Connection pool for

How and Where to add JNDI for Hibernate?

匆匆过客 提交于 2019-12-04 19:43:44
问题 I need the code to add JNDI name to achive connection pooling in hibernate. I have configured the connetion pooling in Jboss server with the JNDI name as "EmployeeDB" How to configure it in hibernate.cfg.xml ?? Plez give me the code for hibernate.cfg.xml if i am using Hibernate 4 Final release. 回答1: The datasource JDNI name configured in the Jboss server is specified by the properties hibernate.connection.datasource . The basic hibernate.cfg.xml should look like : <?xml version='1.0' encoding

JBoss AS 5 database connection pool re-connect routine for MS SQL Server

耗尽温柔 提交于 2019-12-04 19:25:02
I'd like to come up with the best approach for re-connecting to MS SQL Server when connection from JBoss AS 5 to DB is lost temporarily. For Oracle, I found this SO question: "Is there any way to have the JBoss connection pool reconnect to Oracle when connections go bad?" which says it uses an Oracle specific ping routine and utilizes the valid-connection-checker-class-name property described in JBoss' Configuring Datasources Wiki . What I'd like to avoid is to have another SQL run every time a connection is pulled from the pool which is what the other property check-valid-connection-sql

ODP.net Connection Pooling: ClientID, Client Identifier never changes from first user who logs in

喜夏-厌秋 提交于 2019-12-04 19:24:30
Scenario : We have an application that is using Oracle 10g and the latest version of ODP.net within an ASP.net application. We are utilizing the .ClientID WriteOnly property on the OracleConnection object to pass in a specific UserID to the database for auditing purposes. When Connection Pooling is disabled, this works perfectly. When it is enabled, the first person who logs in (ex: USER1) updates a record and the MODIFIED_BY is USER1, but when a different user heads into the website after, thus grabbing the pooled connection, the MODIFIED_BY is still USER1 despite passing in USER2 to the

Detecting unusable pooled SqlConnections

无人久伴 提交于 2019-12-04 18:38:33
When I attempt to set an application role on a SqlConnection with sp_setapprole I sometimes get the following error in the Windows event log... The connection has been dropped because the principal that opened it subsequently assumed a new security context, and then tried to reset the connection under its impersonated security context. This scenario is not supported. See "Impersonation Overview" in Books Online.) ... and a matching exception is thrown in my application. These are pooled connections, and there was a time when connection pooling was incompatible with app roles - in fact the old

Best approach for returning connection objects to HikariCP pool

好久不见. 提交于 2019-12-04 17:13:55
问题 I am trying to use HikariCP connection pool. I was able to get it to work and get a connection that I could use. I am not sure what is the best approach for returning the connection to the pool. I have the following questions: Should I close the connection when I am done, rely on idleTimeout and maxLifetime settings or is there another call that I can use so as not to hog the connections from the pool? If I close the connections (instead of returning to the pool), would that not result in

Running out of connections in pool

99封情书 提交于 2019-12-04 16:55:50
I have a web forms app that will display a list of records in a GridView and by checking multiple checkboxes you can mass delete the records. The code itself is straightforward: protected void btnDelete_Click(object sender, EventArgs e) { int i = 0; try { foreach (GridViewRow row in GridView1.Rows) { CheckBox cb = (CheckBox)row.FindControl("ID"); if (cb != null && cb.Checked) { int profileID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value); Profile profile = new Profile(profileID); //instantiate profile profile.Delete(); //call delete method i++; } } if (i > 0) { //report success to

Java single worker thread for SQL update statements

自作多情 提交于 2019-12-04 16:32:25
I'm working on a Java-based server in which I will have multiple threads (one thread for each connected user + some extra). There will be some database connection involved, so I was thinking that each time the server makes a SELECT query to the database it will start a new thread for this, to prevent blocking from the current thread. I'm planning on using a connection pool for this and I think I know how to do that. (I've looked into C3P0 ) However, there will be a lot of UPDATE statements involved also, but it's not important that these are ran directly, it's ok with a delay here. And since