connection-pooling

What are best practices on managing database connections in .NET?

旧城冷巷雨未停 提交于 2019-11-30 08:59:54
Regarding best practice for managing database connections in a .NET application -- I know that, in general, it's bad to pass around a connection object. However, I have some specific curiosities: 1. I have two instances of business objects, of different classes, in a parent-child relationship (the child is private.) Which of the following is best? Keep one private static connection open and shared, used by both objects, and left open until the parent is disposed. Keep two private static connections open, one for each object, not to be closed until the object is disposed. Do not keep static

how long must a sql server connection be idle before it is closed by the connection pool?

夙愿已清 提交于 2019-11-30 08:45:27
I have a client-server app that uses .NET SqlClient Data Provider to connect to sql server - pretty standard stuff. By default how long must connections be idle before the connection pooling manager will close the database connection and remove it from the pool? What setting if any controls this? This MSDN document only says The connection pooler removes a connection from the pool after it has been idle for a long time, or if the pooler detects that the connection with the server has been severed. A few years ago the answer beneath was the situation, but now it's changed so you can refer to

django 1.7 and connection pooling to PostgreSQL?

爷,独闯天下 提交于 2019-11-30 08:37:29
What are the differences between the django apps (Django-PostgresPool, djorm-ext-pool, django-db-pool) and PG Bouncer or PG Pool? Do the apps use one of the last two packages? In this article , the author says that there is a patch starting with django 1.6. Does that mean we do not have to use any of these solutions anymore, neither the apps, nor the PG Bouncer or PG Pool package? Postgres database connections are expensive (resources) compared to MySQL connections. Django pooling apps will open many connections and keep the open. PG Bouncer and PG Pool will open fewer connections to Postgres,

Problem with OleDbConnection, Excel and connection pooling

孤街醉人 提交于 2019-11-30 07:39:42
问题 So, I have the same symptoms as described in C#/ASP.NET Oledb - MS Excel read "Unspecified error", but my my answer did not seem to fix it. Even always closing the OleDBConnection and disposing of it show the same symptoms. var connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0; data source={0}; Extended Properties=Excel 12.0;", _excelFile); using (var conn = new OleDbConnection(connectionString)) { try { DoSomething(); } finally { conn.Close(); } } Now I have found the

Creating a database connection pool

旧时模样 提交于 2019-11-30 07:37:18
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? Your question is a bit ambiguous: Do you want to homegrow a connection pool implementation? If so, this is a nice starting point: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html But this is highly discouraged for production environments. Better use an existing and thoroughly tested connection pooling API, like DBCP or C3P0 . Or do you want to know how to

Apache PoolingHttpClientConnectionManager throwing illegal state exception

跟風遠走 提交于 2019-11-30 06:46:43
问题 Here is how I use it - private static final PoolingHttpClientConnectionManager connPool; static { connPool = new PoolingHttpClientConnectionManager(); // Increase max total connection to 200 connPool.setMaxTotal(200);//configurable through app.properties // Increase default max connection per route to 50 connPool.setDefaultMaxPerRoute(20);//configurable through app.properties } CloseableHttpClient httpClient = HttpClients.custom() .setConnectionManager(connPool) .build(); ALso I have put a

java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactory

守給你的承諾、 提交于 2019-11-30 06:34:01
问题 I'm investigating moving away from an Oracle connection pool and using the Tomcat connection pool. I followed the myriad of example for configuring the <Resource> in Tomcat's /conf/server.xml . I found great info here. However, when I start Tomcat, I get the following error: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactory] I'm using Tomcat 6.0. My <Resource> config in /conf

Is there a way to share object between php pages?

浪尽此生 提交于 2019-11-30 05:03:56
I am new to php, but in other web technologies, you can share objects between page instances. For example, in java jsp pages you easily have on class that exist as static class for the whole server instance. How to do this in php? I am not refering to sessions variables (at least I don't think so). This is more for the purpose of resource pooling (perhaps a socket to share, or database connections etc). So a whole class needs to be shared between subsequent loads, not just some primitive variables that I can store in the session. I have also looked into doing php singleton classes but I

node-mysql connection pooling

和自甴很熟 提交于 2019-11-30 04:58:54
I am using node-mysql module ( https://github.com/felixge/node-mysql ) OR ( http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/ ) . Is this API handling connection pooling as well? I mean with every user request I am calling Client.connect() to query the MySQL and to release the connection: Client.end() . Is this the right way, or should I connect/disconnect only once in a code. I am learning from this document: https://github.com/felixge/node-mysql/blob/master/Readme.md Update: Feb 2013 - pool support has been added to node-mysql, see docs Example using built-in pool: var pool =

JDBC Connection Pooling: Connection Reuse?

倾然丶 夕夏残阳落幕 提交于 2019-11-30 02:36:22
As per my understanding, JDBC Connection Pooling (at a basic level) works this way: create connections during app initialization and put in a cache provide these cached connections on demand to the app a separate thread maintains the Connection Pool, performing activities like: discard connections that have been used (closed) create new connections and add to the cache to maintain a specific count of connections But, whenever I hear the term "connection reuse" in a JDBC Connection Pooling discussion, I get confused. When does the connection reuse occurs? Does it means that Connection Pool