connection-pooling

Java servlets and database connection pooling.

Just looking at examples of connection pooling on the web, they all implement connection pooling on a per servlet basis. So each servlet has its own pool of database connections. My question is, why is that preferable to something like a global pool of db connections? Since a global pool is seems more efficient than a per servlet poo...

MySQL - Connection using Singleton pattern or a ConnectionPool?

The topic has already been on the table in some previous questions. New elements come with new problems. I am seeking here for the best way to handle database connection(s), concerning aspects of : maintainability, performance, security and implementation. I must mention that i am not interested in abstractions like Hibernate, Spring, et...

Cancel/abort a connection from the ThreadSafeClientConnManager connection pool

I'm using ThreadSafeClientConnManager to manage a pool of client connections, because my application has several threads, which are simultaneously connecting to a webserver. Abstract sample code: HttpClient httpClient; ClientConnectionManager conMgr = new ThreadSafeClientConnManager(parameters,schReg); httpclient = new DefaultHttpClie...

Java connection pool without JNDI?

Hi, I've a connection pool to access a MySQL DB from a servlet. I get the data source using a JNDI, which is defined on my META-INF/context.xml file. Everything is working fine, but I have to place the MySQL driver JAR within Tomcat's /common/lib folder, instead of webapp's WEB-INF/lib; otherwise the JNDI will not work (ClassNotFoundEx...

How do you manage database connections in php?

So recently I've really started to use php actively, and I need some insights on different ways to use database connections. At first I just used the simple mysql_connect(): <?php $connection = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error()); mysql_select_db(DB_DB, $connection); ?> After a while I created a da...

we implement connection pooling ourselves, but why it always out of connection ?

Following is the source code: //public class ConnectionPool implements Runnable public class ConnectionPool { private static Logger loger_error = Logger.getLogger("error"); // JDBC Driver name String driverName; // JDBC Connection URL String connectionURL; // Minimum size of the pool int connectionPoolSize;...

How do I track orphaned JDBC connections that are not closed?

We've found a bug in old code where connections aren't being closed. It's an easy fix, but I'm wondering how we go about proving that it's fixed. There is a choice of using a connection pool or not. For the pooling use it would be easy to add monitoring for the pool, but when connections pooling is not used, how do we track those unclos...

Does anyone have any performance metrics of ADO.NET connection pooling vs. the create-and-destroy method?

I'm using WCF, SQL Server and ADO.NET. I'm looking at two implementation options for the data access layer. The Enterprise Library that uses connection pooling A custom solution that does not use connection pooling. Every time the database is accessed a connection is created, used and then destroyed. Option 2 looks like this: using ...

Reuse NSURLConnection objects?

I've got an app that will be doing a fair amount of communication with a server over HTTP, and these connections may be overlapping. I'm planning to load the data asynchronously. I understand that there is a performance hit associated with allocating memory, so I figured the smart thing to do would be to keep a set of available connect...

hibernate c3p0 broken pipe

Hi, 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 exceptio...

SharePoint use of windows identity and connection pooling

When a user accesses a SharePoint site he is identified by his wndows identity. I was wondering which identity is used to access the database. Is it the identity of the user or does it use the windows identity of a service, or order to gain the benefits of connection pooling. Thanks Shiraz ...

what is the easiest way to have multiple db connections when using linq

Optimally I would like linq to use X database connections instead of 1 to speed things up. The only way now is to open X connections, and create X databasecontexts, and associate them. It would be easier if somehow I could tell linq to use X connections. Is this possible? Or is there another way to speed up database queries? thanks e...

Creating a database connection pool.

Need information on creating a connection pool to the database (irrespective of the database) , and how efficient they are? What are the conditions where they can enhance performance. How to create it explicitly? ...

SQL Server pooling Issue

Hi Friends I have written a web application in which I have not allowed connection pooling for this application. I have written sample code as shown below which gets record from my table 20 times and fill in Data set I have close connection at every time. But if I look in SQL Server Activity monitor it shows me one connection open in ...

HTTPS requests and multi-threading

Is Java's URL class a thread-safe, in particular URL.openConnection()? In my application, I make tens of concurrent HTTPS connections a second to the same URL, and I would like to maximize object reuse. Yet, it's not clear from the documentation what can be reused. EDIT: I'm open to using a different library if needed. ...

Classic ASP - using one connection for many queries?

Consider a classic ASP site running on IIS6 with a dedicated SQL Server 2008 backend... Scenario 1: Open Connection Do 15 queries, updates etc all through the ASP-page Close Connection Scenario 2: For each query, update etc, open and close the connection With connection pooling, my money would be on scenario 2 being the most effec...

COM+ Connection Pooling Doesn't Appear to be working on SQL Server 2005 Cluster

We have a COM+ Data Layer that utilized Connection Pooling. Its deployed to 3 clusters, 2 SQL Server 2000 and 1 SQL Server 2005 environment. We noticed today that our monitoring software is reporting Thousands of Logins per minute on the SQL Server 2005 box. I did some tracing in both environments and profiler is reporting this for th...

Connection Pooling and Multiple Connection Strings

An ASP.NET 3.5 application has two connection strings: Data Source=RedDB;Initial Catalog=Red;User Id=myuser;Password=pas;Max Pool Size=50;Min Pool Size=1 Data Source=BlueDB;Initial Catalog=Blue; User Id=myuser;Password=pas;Max Pool Size=375;Min Pool Size=2 Suppose the RedDB connection has a stored procedure that is hanging indefinite...

Connection Pooling on Oracle 11g w/ asp.net

What is the best way to handle connection pooling with Oracle 11g and asp.net, I'm having issues where Oracle refuses to open up any new connections for the web app after a while. This causes the request to time out and queue up.! EDIT: Is there anything that I need to do in Oracle to fine tune this? ...

How to calculate the size for a database connection pool?

Say I'm expecting about 100 requests a second, each request should take anywhere between 1 - 3 seconds (In a perfect world). Would I create a pool of 300 connections? Or something slightly higher to compensate for potential spikes? ...