connection-pooling

JDBC MySql connection pooling practices to avoid exhausted connection pool

a 夏天 提交于 2019-12-17 01:04:12
问题 I have a Java-JSF Web Application on GlassFish, in which I want to use connection pooling. Therefore I created an application scoped bean that serves with Connection instances for other beans: public class DatabaseBean { private DataSource myDataSource; public DatabaseBean() { try { Context ctx = new InitialContext(); ecwinsDataSource = (DataSource) ctx.lookup("jdbc/myDataSource"); } catch (NamingException ex) { ex.printStackTrace(); } } public Connection getConnection() throws

JDBC connection pool compatible with App Engine

会有一股神秘感。 提交于 2019-12-14 03:41:27
问题 Note: I know about this thread but it is quite old and moreover, the solution did not work for me. I am using App Engine along with Cloud SQL and I would like to share a pool of open connections between all of the application's current users. I have tried several connection pool implementations and they all work perfectly with the local development server, however, when deployed to the cloud, they fail. I suppose that the reason is App Engine's restricted "sandbox" environment. Does anyone

Jdbc Connection Pool with Sql Server 2008 fails

独自空忆成欢 提交于 2019-12-13 20:22:59
问题 I am trying to turn my jdbc code to use Connection Pool functionality on Tomcat. My system is a jsp/servlet application that connects to an SQL Server 2008. So, lets get to the code... My Connection class looks like this: import org.apache.tomcat.jdbc.pool.DataSource; import org.apache.tomcat.jdbc.pool.PoolProperties; //... some more imports public class DbPooledConnectionToMSSQL { public String dbsource ; private Connection dbCon; private DataSource datasource = new DataSource(); private

Connection pool – one process – many threads

元气小坏坏 提交于 2019-12-13 16:37:10
问题 My understanding of the connection pool is; if the connectionstring is the exact same, then we reuse the connection instead of make a new connection. My problem is that I’m creating many threads for parallel processing. In this “dummy” program, I create 500 threads and let the ThreadPool function handle the threads. The steps are: Each thread make an update table in SQL. (Stating the timestamp for the update) Then the thread sleeps between 1 to 10 sec (random). At the end the thread makes

How can I get Tomcat's connection pool stats?

a 夏天 提交于 2019-12-13 15:22:20
问题 I need to get the stats of my tomcat server's connection pool from the deployed webapp. like., active connection count , idle connection count , pool size , last wait time etc., I was to able to get some stats from org.apache.tomcat.dbcp.dbcp.BasicDataSource (narrowed from java.sql.DataSource through JNDI) . But its not providing the stats like last connection wait time etc., Is there any other (better) way to retrieve these stats ? Thanks in advance. 回答1: We create a singleton instance (per

In the java DBCP connection pool - what is an idle connection?

人走茶凉 提交于 2019-12-13 14:10:13
问题 A colleague at work insists that a DBCP idle connection is a connection that has lain unused for 30 minutes. I believe a dbcp idle connection is a connection that is in the pool available to be borrowed, and an active connection is one that is borrowed. Looking through the code I found no reference to 30 minutes or other magic values and a cursory glance through the code for assuring minidle does not show any such logic. If he is correct can you please back that up with a code or

Application vs Database Resident Connection Pool

元气小坏坏 提交于 2019-12-13 13:38:23
问题 Situation: I have a requirement to use connection pooling while connecting to Oracle database in python. Multiple python applications would use the helper connection libraries I develop. My Thought Process: Here I can think of two ways of connection pooling: 1) Let connection pool be maintained and managed by database itself (as provided by Oracle's DRCP) and calling modules just ask connections from the connection broker described by Oracle DRCP. 2) Have a server process that manages the

Externalizing tomcat jdbc connection pool information for different environments

妖精的绣舞 提交于 2019-12-13 12:14:07
问题 Greetings, I'm looking for a good solution for externalizing the JNDI connection pool information in context.xml of a war so that as the application moves from dev to QA to prod, the war file won't need to be recompiled. Ideally the url, driver, username and password would be variablized and then populated by means of a properties file that would customized for each environment. If this isn't possible, are there other suggestions on how to handle moving a war across environments without

Is there a standard mysql connection pooling library for C?

陌路散爱 提交于 2019-12-13 11:47:38
问题 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. 回答1: 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

choose a db connection pool

流过昼夜 提交于 2019-12-13 05:19:41
问题 we want to use a db connection pool in our applicationl,however thear are so many open soure pools,like dbcp,c3p0,proxool and etc. I have no idea which is better,any one have some experience about them? 回答1: I'd recommend using the one that is built into your Java EE app server if you're using one. That's should be sufficient. Why add another dependency? I'd recommend using DBCP from Apache. It'll work just fine for your purposes. 回答2: As author of BoneCP (http://jolbox.com), I invite you to