connection-pooling

BoneCP doesn't recover from broken connection

你说的曾经没有我的故事 提交于 2019-12-12 11:24:49
问题 I have a problem with BoneCP (0.7.1 RELEASE). I though that BoneCP.getConnection() ensures it would return Connection object assuming that DB is alive. Here is how I configured my pool private void setupConnectionPool() throws SQLException { // setup the connection pool String connectUri = "jdbc:mysql://master-mysql:3306/base?zeroDateTimeBehavior=convertToNull&tinyInt1isBit=false&useCompression=true"; BoneCPConfig config = new BoneCPConfig(); config.setJdbcUrl(connectUri); config.setUsername(

Auto-commit changes to TRUE after a while using a connection pool

 ̄綄美尐妖づ 提交于 2019-12-12 11:16:41
问题 I got some strange problem. I use a Pool to create and manage DB Connections, I set the DefaultAutocommit option to FALSE . But after a while, when an error occur and a rollback is called an Exception is thrown : Can't call rollback when autocommit=true Relaunching JBoss will solve the problem as a new DataSource will be created. Here is how I create my Datasource : protected DataSource getDataSource(String driverClassName, String dbUrl, String dbUser, String dbPwd) { PoolProperties

Using c3p0 connection Pooling in a tomcat Spring based App

怎甘沉沦 提交于 2019-12-12 11:01:30
问题 I have a Spring Based Web App running under tomcat 6. Now, I want to use c3p0 connection pooling instead of tomcat's default DBCP. So, from the c3p0 help doc, I have defined the data source in context.xml something like: <Resource name="jdbc/sample" auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@someServer:1551:xyz" username="userName" password="pwd" validationQuery="SELECT 1 FROM dual" testOnBorrow="true" testWhileIdle="true" factory="org.apache

Why aren't connections being reused in my iSeries/ASP.NET MVC 4 app?

为君一笑 提交于 2019-12-12 08:21:31
问题 We are running an MVC 4 web application on a Windows 2008 server farm. We have been trying to upgrade our server farm to Windows 2008 R2 64-bit servers but have run into an issue with connection pooling on an iSeries (running V7R1). We frequently call DB2 java stored procedures and have enabled connection pooling to reduce the time it takes to establish connections. Below is an example of the connection string we’re using. <add name="DB2" connectionString="ConnectionTimeout=45;Pooling=true

Getting OSGi services from a bundle in Sling/CQ

寵の児 提交于 2019-12-12 07:32:49
问题 I am using Day CQ. I want to store some data in a SQL Server DB, using the connection pool available in the Felix console. I can do this from a JSP, by using the "sling" object of type SlingScriptHelper defined in the defineObjects tag sling.getService(DataSourcePool.class). However, I want to use a servlet created in an OSGi bundle to handle requests from the client. The servlet doesn't have a defineObjects tag, so the "sling" object is not defined. I don't see a way to create a valid

Need suggestion on how to work with connection polling in java(jsp&servlet)

喜欢而已 提交于 2019-12-12 06:16:07
问题 I'm developing a simple project.In this project i'm using n no of jsp pages and servlets to interact with the database. How i have to write the connection string. Presently i written the connection string each and every jsp page.(I knew this is not a best practice). Now my question is how i have to manage the connection string? I have to write in only one common page, then i have to utilize that.. How i can implement this ?? Could any one guide me on this?? 回答1: You need to create a JNDI

Tomcat JDBC connection pool for different schema

大憨熊 提交于 2019-12-12 06:06:39
问题 How do we configure 2 different schema for the same database using tomcat jdbc. Do we need to create two different configuration of tomcat jdbc pool connection for different schema or is it possible to configure a single jdbc connection pool then use this connection pool to connect to two different schema. 回答1: That depends If your two schema share the same credentials and are hosted on the same db server, you could probably use one pool. But then you'd have to include schema in all your

jetty and Oracle Connection Pooling

孤者浪人 提交于 2019-12-12 05:42:03
问题 I am currently moving my Oracle Datasource pool creation from my Spring config to a jetty config, but I am getting the error below [WARNING] Config error at My Datasource config in Spring looks like @Bean public DataSource dataSource() throws IllegalStateException, SQLException { PoolDataSource dataSource = PoolDataSourceFactory.getPoolDataSource(); dataSource.setConnectionFactoryClassName(env.getRequiredProperty(DB_CONNECTION_FACTORY_CLASS_NAME)); dataSource.setURL(env.getRequiredProperty

JDBC error when connecting Tomcat 5.5 to SQL 2008: What am I missing?

邮差的信 提交于 2019-12-12 04:39:54
问题 I'm attempting to connect a Tomcat 5.5 instance on my workstation (running with Eclipse) to a SQL Express instance on my workstation, and I'm having some connection issues. I'm getting this exception: Cannot create JDBC driver of class '' for connect URL 'null' Here's my META-INF/context.xml: <Context> <Resource name="jdbc/SQLDB" auth="Container" type="javax.sql.DataSource" username="AppUser" password="password" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc

shared c3p0 connection pool with hibernate and mysql on tomcat

江枫思渺然 提交于 2019-12-12 04:17:47
问题 Iam working on a project where i want to configure a shared connection pool with hibernate on tomcat. The project is already implemented and i have to change it. It was configured with hibernate and c3p0 connection pool where all jars where in the project itself. I copied all jar files for connection pooling into the lib folder of tomcat . c3p0-0.9.5.2.jar c3p0-oracle-thin-extras-0.9.5.2.jar mchange-commons-java-0.2.11.jar mysql-connector-java-5.1.40-bin.jar in server.xml i made a Resource