connection-pooling

What is the benefit of Connection and Statement Pooling?

爱⌒轻易说出口 提交于 2019-11-27 19:08:45
Can someone explain what is Connection and Statement Pooling and what is the benefit over unpooled DataSources? I am trying to understand when it is a good idea to use a technology like c3p0 or proxool in a project. I need first to understand what they do and when it interesting to use them. Thank you very much. The Happy Connection It's so easy to create a new connection every time. One line: that's all it takes. Nothing much to think about. Great life. Hold on. Do you eat on a plate? Do you throw away your plate after each use? No, you wash it and put it on the dish rack, so you can use it

WebApp (Tomcat-jdbc) Pooled DB connection throwing abandon exception

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 19:07:32
I have been browsing SO for some time, and chewing my hat in the process, but cannot find an exact match to my problem. For short, I am getting superb stack trace (org.apache.tomcat.jdbc.pool.ConnectionPool abandon) after 60 seconds of inactivity, which is a normal behavior for a couple of server side threads. I am using Tomcat JDBC Connection Pooling (org.apache.tomcat.jdbc.pool.DataSource) directly Stack Trace: Oct 29, 2012 8:55:50 PM org.apache.tomcat.jdbc.pool.ConnectionPool abandon WARNING: Connection has been abandoned PooledConnection[com.mysql.jdbc.JDBC4Connection@1ad2916]:java.lang

best practice of django + PyMongo pooling?

回眸只為那壹抹淺笑 提交于 2019-11-27 18:20:25
问题 I have a db = pymongo.Connection() call in Django's views.py for a simple MongoDB connection to store some simple statistics. What's the best practice to make it auto support MongoDB connection pooling? Where do I need to put the end_request() code? How do I choose the max_pool_size parameter during connection? 回答1: How does connection pooling work in PyMongo? Every Connection instance has built-in connection pooling. By default, each thread gets its own socket reserved on its first operation

Basic DB connection pool with Java and Tomcat 7

▼魔方 西西 提交于 2019-11-27 17:57:38
问题 I'm trying to create my first connection pool. I'm creating a Java web aplication with Tomcat 7 and a MySQL DB, and I'd like to create the simplest connection pool possible. I've taken a look at several tutorials but it's not really clear for me, so I'd like you to confirm if I'm doing well. I've written the following class as a connection pool manager: package dao.mysql; import java.sql.Connection; import java.sql.SQLException; import org.apache.tomcat.jdbc.pool.DataSource; import org.apache

HikariCP: What database level timeouts should be considered to set maxLifetime for Oracle 11g

↘锁芯ラ 提交于 2019-11-27 16:12:40
In the documentation for HikariCP, it is mentioned that We strongly recommend setting this value, and it should be at least 30 seconds less than any database-level connection timeout. What are those database-level connection timeouts that should be taken into account for Oracle11.2 database? And how could I find those timeouts (queries to execute)? Short answer: none (by default). For the record (to include details here in case the link changes), we're talking about property maxLifetime of HikariCP : This property controls the maximum lifetime of a connection in the pool. An in-use connection

Is HTTP connection pooling possible?

巧了我就是萌 提交于 2019-11-27 15:17:19
问题 For a C# webservice that contacts a limited set of other servers, I wish to create 1 HTTP connection pool per server that I want to be able to contact. The basic concept of course: Each pool should open a few connections (3 connections?) to its remote webserver, and keep those connections alive. A max-time-to-life should be used to recycle (disconnect/reconnect) the connections to the remote webserver, preventing the remote web server to disconnect before we do. The connections should not be

http request with timeout, maximum size and connection pooling

夙愿已清 提交于 2019-11-27 14:07:25
问题 I'm looking for a way in Python (2.7) to do HTTP requests with 3 requirements: timeout (for reliability) content maximum size (for security) connection pooling (for performance) I've checked quite every python HTTP librairies, but none of them meet my requirements. For instance: urllib2: good, but no pooling import urllib2 import json r = urllib2.urlopen('https://github.com/timeline.json', timeout=5) content = r.read(100+1) if len(content) > 100: print 'too large' r.close() else: print json

Node.js Redis Connection Pooling

末鹿安然 提交于 2019-11-27 13:52:27
问题 When using node_redis Node.js module with Redis, should I just use one connection as Redis is single thread process or shall I create a pool of connections to improve performance? 回答1: Just use a single connection. Both Node and Redis are effectively single thread. I don't think you'll gain anything by having multiple connections. I asked a similar question before starting to develop with Redis and it seems that one client/one application is pretty effective pattern. 回答2: There is a use case

java - DataSource for standalone application - no application server

。_饼干妹妹 提交于 2019-11-27 13:50:17
I want to connect to a MySQL database from a standalone application. There is no application/web server. This page suggests that I should use DriverManager to create the connection. However this page suggests that connections created from DriverManager cannot be pooled. However connection pooling is a must for me because the application uses various threads to write to the database concurrently, so closing/recreating connections is not optimal. Which DataSource implementation should I use for this purpose? I looked at MysqlConnectionPoolDataSource but I am not sure if it actually implements a

Initialcontext in a standalone Java program

﹥>﹥吖頭↗ 提交于 2019-11-27 12:57:01
问题 I'm using a JNDI for creating tomcat connection pool. It works great in a web application. I believe the InitialContext is provided by the tomcat server. Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); dataSource = (DataSource)envContext.lookup("jdbc/testdb"); But when I try to call the same utility from a standalone Java program, the initContext object is null. How can I explicitly provide all the necessary properties that