connection-pooling

Connection pool problem with Spring and programmatic transaction management

三世轮回 提交于 2019-12-12 04:06:49
问题 I need your help in order to solve connection pool problem with Spring. I’m using Spring with Java 1.4 (no annotation). Here is the datasource and the connection pool definition: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>${database.jdbcName}</value> </property> <property name="url" value="jdbc:sybase:${database.url}"> </property> <property name="username"> <value>${database.username}</value> <

no suitable driver exception in connection pooling

霸气de小男生 提交于 2019-12-12 03:46:33
问题 I am trying to implement connection pooling using servlet. I know there are lots of similar questions has been asked but none is able to help. Here is exception : java.sql.SQLException: Cannot create JDBC driver of class for connect URL null at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2160) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2032) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection

Connection handling in EJB2 session beans

十年热恋 提交于 2019-12-12 03:20:04
问题 I recently started maintaining an old EJB2 application running on OC4J. That includes EJB doclet and other horrible horrible things. Currently, each method creates a ConnectionFactory that queries JNDI for a Datasource , which then creates a connection. This leads to a lot of boiler plate code. My question now is: is it safe to do this only once per stateless session bean, and reuse the same connection? ejbCreate() would get the connection from JNDI, and then close it in ejbRemove() . Would

Not able to initialise application data source on creating a connection pool using BoneCP

佐手、 提交于 2019-12-12 03:14:36
问题 I have tried database connection pooling using BoneCP with struts but on Running the program i got the folling LOG Please help. Thanks in advance. Feb 19, 2012 4:52:22 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /DbcpDemo threw load() exception javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:812) at org.apache.struts

Connection pooling in java using c3p0

↘锁芯ラ 提交于 2019-12-12 03:09:15
问题 I want to using c3p0 for connection pooling in none-web application java program that i wrote. I used traditional singleton connection and I am not satisfied with its performance, so I decided to go for connection pooling. I take a look at c3p0 website and here is what they told about using c3p0: ComboPooledDataSource cpds = new ComboPooledDataSource(); cpds.setDriverClass( "org.postgresql.Driver" ); //loads the jdbc driver cpds.setJdbcUrl( "jdbc:postgresql://localhost/testdb" ); cpds.setUser

NodeJS + mysql: using connection pool leads to deadlock tables

匆匆过客 提交于 2019-12-12 03:04:19
问题 I am using NodeJS and mysql library to access MySQL database. When I establish single connection and repeatedly use it, it works fine: global.mysql = mysql_module.createConnection({ host: config.mysql.host, user: config.mysql.user, password: config.mysql.password }); When I use connection pool instead, I get ER_LOCK_WAIT_TIMEOUT errors in transactions. global.mysql = mysql_module.createPool({ host: config.mysql.host, user: config.mysql.user, password: config.mysql.password, database : config

Rails Puma running out of Redis connections

和自甴很熟 提交于 2019-12-12 03:01:52
问题 I've looked around at other similar questions on SO but can't quite piece things together well enough. I have a Rails app (on Heroku) that uses Puma with both multiple processes and multiple threads. My app also uses Redis as a secondary data store (in addition to a SQL database), querying Redis directly (well, through the connection_pool gem). Here's my Puma config file: workers Integer(ENV["WEB_CONCURRENCY"] || 4) threads_count = Integer(ENV["MAX_THREADS"] || 5) threads threads_count,

Execute a sql statement when a connection is created

坚强是说给别人听的谎言 提交于 2019-12-12 02:54:15
问题 For our application to work properly we need to execute a SQL Statement on every new connection, before that connection is handed out to the application. How do I configure a data source in WAS 7 accordingly? We found the (deprecated) option to validate the datasource using a sql statement, which hopefully does the trick (coworker is testing it right now). This sounds wrong, since we are not 'testing' the connection, but setting it up properly. Also its deprecated so this probably will stop

Can MAX_UTILIZATION for PROCESSES reached cause “Unable to get managed connection” Exception?

大憨熊 提交于 2019-12-12 02:44:35
问题 A JBoss 5.2 application server log was filled with thousands of the following exception: Caused by: javax.resource.ResourceException: Unable to get managed connection for jdbc_TestDB at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:424) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection

c3p0 hangs on getConnection when there is a network failure

送分小仙女□ 提交于 2019-12-12 02:41:02
问题 I'm using c3p0 ComboPooledDataSource to pool database connections (to an Oracle 10g database). I'm having problems with handling database connectivity outages. If there is no connection to the database when the first connection is being acquired, the checkout timeout fires and it fails as expected. However, if a connection outage occurs after one or more connections have been acquired and are already in the connection pool, calling getConnection() just hangs. No exception is thrown. I'm