connection-pooling

Is DB connection pooling all that important?

别说谁变了你拦得住时间么 提交于 2019-12-21 22:04:24
问题 In the Java world it is pretty standard for app servers to pool "expensive" resources, like DB connections. On the other hand in dynamic languages, most stacks have little to do with pooled resources and especially DB connections. E.g. for the popular PHP+MySQL combo, I've rarely seen it used with persistent connection, which can be considered poor-mans pooled connections. If the concept of pooling DB connections is not that widely implemented, does this mean that the performance/scalability

Java single worker thread for SQL update statements

我是研究僧i 提交于 2019-12-21 21:36:37
问题 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

How to log Tomcat 7 JDBC connection pool, connection creation

谁说我不能喝 提交于 2019-12-21 20:30:49
问题 I'm trying to debug what seems to be an excessive number of database connections being opened and closed despite the fact that we are using the Tomcat 7 JDBC connection pool. How can I log when calling getConnection() on the data source results in a new connection being opened versus an existing connection being borrowed from the pool? 回答1: I have faced a similar case today. I log through slf4j, and my problem was caused by hibernate. What I've done is setting up in the log configuration the

Oracle data source connection pooling not working used with Spring and JDBCTemplate

非 Y 不嫁゛ 提交于 2019-12-21 20:28:29
问题 Question: Lot of active unclosed physical connections with database even with connection pooling. Can someone tell me why is it so? I configured the connection pool settings using oracle.jdbc.pool.OracleDataSource . However it seems the physical connections are not getting closed after use. I thought, Since it is connection pooling, the connections will be reused from the pool, so so many physical connections will not be made, but thats not what is happening now! There are 100+ active

tomcat 7 JDBC connection pool - separate pool for each database?

我只是一个虾纸丫 提交于 2019-12-21 19:16:12
问题 I have a basic question about the Tomcat 7 JDBC Connection Pool: is a separate pool created for each separate database (i.e., URL)? Or is a single pool created that holds open connections from any number of different databases? For example, if I open connections to databases A and B by doing this: PoolProperties poolProperties = new PoolProperties(); poolProperties.setDriverClassName("org.postgresql.Driver"); poolProperties.setUrl("jdbc:postgresql://myserver/db_a"); poolProperties

How to preinitialize DBCP connection pool on startup?

血红的双手。 提交于 2019-12-21 17:29:12
问题 The setup of my project is - Spring JDBC for persistence Apache DBCP 1.4 for connection pooling Mysql 5 on Linux Here is the log of my application that captures the interactions with the database. 2013-01-29 15:52:21,549 DEBUG http-bio-8080-exec-3 org.springframework.jdbc.core.JdbcTemplate - Executing SQL query [SELECT id from emp] 2013-01-29 15:52:21,558 DEBUG http-bio-8080-exec-3 org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 2013-01-29 15:52

Long lasting 'COMMIT' queries with 'idle' state in pg_stat_activity

回眸只為那壹抹淺笑 提交于 2019-12-21 07:44:06
问题 If I query: select * from pg_stat_activity where application_name ~ 'example-application'; I get many rows which state is idle and query is COMMIT . They are long lasting and do not disappear. After some time, my application reach hibernate.c3p0.max_size (maximum number of JDBC connections in the pool) limit and stops working with database. Some application implementation details are described in other SO thread: Guice DAO Provider in thread pool - queries become 'idle in transation' Why does

SQLite Connection Pool in Java - Locked Database

时光总嘲笑我的痴心妄想 提交于 2019-12-21 06:09:15
问题 I have already read several related threads about SQLite in multi-threaded environments but I could not find a clear statement, so forgive me that I bring up this topic yet another time. I need to access the application's database from multiple threads to execute update statements. The database itself can be SQLite or MySQL, depending on the users choice. For the MySQL handler, I have implemented a connection pool using the tomcat-jdbc library. Now I am searching the best way for the SQLite

Is there any reason to use a database connection pool with ActiveRecord?

六月ゝ 毕业季﹏ 提交于 2019-12-21 05:51:31
问题 What are the benefits to using an external connection pool? I've heard that most other applications will open up a connection for each unit of work. In Rails, for example, I'd take that to mean that each request could open a new connection. I'm assuming a connection pool would make that possible. The only benefit I can think of is that it allows you to have 1,000 frontend processes without having 1,000 postgres processes running. Are there any other benefits? 回答1: Rails has connection pooling

Is there any reason to use a database connection pool with ActiveRecord?

我们两清 提交于 2019-12-21 05:51:15
问题 What are the benefits to using an external connection pool? I've heard that most other applications will open up a connection for each unit of work. In Rails, for example, I'd take that to mean that each request could open a new connection. I'm assuming a connection pool would make that possible. The only benefit I can think of is that it allows you to have 1,000 frontend processes without having 1,000 postgres processes running. Are there any other benefits? 回答1: Rails has connection pooling