connection-pooling

Python mysql (using pymysql) auto reconnect

限于喜欢 提交于 2019-12-03 16:52:12
问题 I'm not sure if this is possible, but I'm looking for a way to reconnect to mysql database when the connection is lost. All the connections are held in a gevent queue but that shouldn't matter I think. I'm sure if I put some time in, I can come up with a way to reconnect to the database. However I was glancing pymysql code and I saw that there is a 'ping' method in Connection class, which I'm not sure exactly how to use. The method looks like it will reconnect first time but after that it

Is there a standard mysql connection pooling library for C?

一笑奈何 提交于 2019-12-03 16:03:28
I have a C application using the MySQL library for database access. Is there a standard way to implement database connection pooling for such an application? The C connector doesn't appear to support it. The Zild Database Library , "a thread-safe high level multi-database connection pool library", looks very promising. Previously I suggested that SQL Relay could be used to do this, amongst many other useful things, such as client-side caching load-balancing across database instances translating between different database access APIs If the MySQL library is dynamically linked this can be done

To close or not to close an Oracle Connection?

我只是一个虾纸丫 提交于 2019-12-03 15:57:27
My application have performance issues, so i started to investigate this from the root: "The connection with the database". The best practices says: "Open a connection, use it and close is as soon as possible", but i dont know the overhead that this causes, so the question is: 1 -"Open, Use, Close connections as soon as possible is the best aproach using ODP.NET?" 2 - Is there a way and how to use connection pooling with ODP.NET? I thinking about to create a List to store some connections strings and create a logic to choose the "best" connection every time i need. Is this the best way to do

Multi-tenancy: Individual database per tenant

孤街浪徒 提交于 2019-12-03 15:18:15
We are developing a multi-tenant application. With respect to architecture, we have designed shared middle tier for business logic and one database per tenant for data persistence. Saying that, business tier will establish set of connections (connection pool) with the database server per tenant. That means application maintain separate connection-pool for each tenant. If we expect around 5000 tenants, then this solution needs high resource utilization (connections between app server and database server per tenant), that leads to performance issue. We have resolved that by keeping common

java.sql.SQLException: Invalid or Stale Connection found in the Connection Cache

喜夏-厌秋 提交于 2019-12-03 14:09:11
问题 I am using spring framework 3.2 with hibernate 4 , I get the above exception when sending a request after a long idle time on the local server ( apache-tomcat v7.0 ) and the database is located on remote server. After hours of search I came to that the problem comes from the connection pool. I tried number of connection pools but didn't find the satisfying solution. bellow is the current datasource on my spring-data file <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy

TransactionScope helper that exhausts connection pool without fail - help?

我是研究僧i 提交于 2019-12-03 14:08:42
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 WinForms app, BTW. Our solution to single-connection-only problem was to create a TransactionScope helper

LISTEN/NOTIFY pgconnection goes down java?

夙愿已清 提交于 2019-12-03 13:31:45
I am using PostgreSQL DB and applying it's LISTEN/NOTIFY functionality. So my listener is at my AS (Application Server) and I have triggers configured on my DB such that when CRUD operations are performed on a table a NOTIFY request is sent on AS. LISTENER class in java: @Singleton @Startup NotificationListenerInterface.class) public class NotificationListener extends Thread implements NotificationListenerInterface { @Resource(mappedName="java:/RESOURCES") private DataSource ds; @PersistenceContext(unitName = "one") EntityManager em; Logger logger = Logger.getLogger(NotificationListener.class)

ADO.NET SQLServer: How to prevent closed connection from holding S-DB lock?

你离开我真会死。 提交于 2019-12-03 11:57:32
i Dispose an SqlConnection object, but of of course it isn't really closed . i need closed connection to not hold locks on database objects. How can i prevent closed connections from holding locks? Explanation of the above sentance for those who don't know: When you close an ADO or ADO.NET connection, you aren't actually severing the connection to SQL Server. The ADO/ADO.NET infrastructure keeps the connection around in case you want to use it again. The connections are kept lingering around in what's called "The Connection Pool". After a few minutes of not being used, the connection will be

How rails database connection pool works

和自甴很熟 提交于 2019-12-03 11:30:16
I am learning rails database connection pool concept. In rails application I have defined pool size of 5. my understanding about connection pool size is as below. When server start rails automatically creates n number of connection defined in the database.yml file. In my case it will create 5 connection since pool size is 5. On every http request if there is need to access database then rails will use available connection from the connection pool to serve the request. But my question is if I hit 1000 request at a time then most of the request will not get access to database connection because

Best approach for returning connection objects to HikariCP pool

落爺英雄遲暮 提交于 2019-12-03 11:16:31
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 additional connection objects being created to meet the requirements of the connection pool size? Looking