connection-pooling

Setup Connection pooling in jsp/servlets application based on MVC?

江枫思渺然 提交于 2019-12-12 02:25:00
问题 I want to use Connection pooling in my java web application with MySQL and JDBC, I found a very resource to learn at Apache Tomcat 6.0 (6.0.35) - JNDI Datasource HOW-TO, But this example uses JSTL code to explain how to retrieve connection from pool. I want to work similarly but with a MVC architecture from scratch consisting of Beans, DAOs, Servlets and JSPs. I got everything I want from a very good DAO tutorial by BalusC but I am confused in the last part of tutorial saying How about

Tomcat connection pooling,idle connections,and connection creation

女生的网名这么多〃 提交于 2019-12-12 01:52:29
问题 I have the following problem in a web application.When i leave the server on for some period for example 24 hours my app stops working. I am using tomcat 7 and Connection pooling.My Database is MySQL. I am getting the following exception: Communication link failure: java.io.EOFException, underlying cause: null ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1394) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket

JDBC connection to remote MySql fails

时光怂恿深爱的人放手 提交于 2019-12-11 23:46:36
问题 In glassfish(3.1.2) I have created a JDBC Connection Pool (and JDBC Resource) to a remote MySql database. When a do a ping test in glassfish it is successful. My Java EE 6 app is using that persistence unit(persistence.xml): <persistence-unit name="remotePU" transaction-type="JTA"> <jta-data-source>jdbc/remotePU</jta-data-source> <properties> </properties> </persistence-unit> In a dao I inject a persistence context: @PersistenceContext(unitName = "remotePU") private EntityManager em; Then I

XMPP Connection Pool

馋奶兔 提交于 2019-12-11 18:12:10
问题 I'm developing service which communicates with users via my own protocol (persistent socket connection). I need to add possibility for users to send and receive messages via XMPP. So, on server I wish to implement connection pool for XMPP connections, but I think it's already done, but google says nothing... Do you now implementations? 回答1: You can use XMPPPool. I wrote that a long time ago and I don't support it in any way. However, there it is. I hope you find it useful. A bit of

Why does not HiveConnection support getHoldability()? Using C3P0 with HiveDriver

╄→尐↘猪︶ㄣ 提交于 2019-12-11 16:14:16
问题 I am trying to use C3P0 ( com.mchange.v2.c3p0.ComboPooledDataSource ) with HiveDriver ( org.apache.hive.jdbc.HiveDriver ). I got an exception of this: java.sql.SQLException: Method not supported at org.apache.hive.jdbc.HiveConnection.getHoldability(HiveConnection.java:924) at com.mchange.v2.c3p0.impl.NewPooledConnection.<init>(NewPooledConnection.java:106) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:159) I found the source

Release a Connection borrowed from ConnectionPool

佐手、 提交于 2019-12-11 16:09:14
问题 ScalikeJDBC's ConnectionPool docs page says: Borrowing Connections Simply just call #borrow method. import scalikejdbc._ val conn: java.sql.Connection = ConnectionPool.borrow() val conn: java.sql.Connection = ConnectionPool('named).borrow() Be careful. The connection object should be released by yourself. However there's no mention of how to do it. I can always do Connection.close() but by ' releasing ' Connection , I understand that I'm supposed to return the Connection back to the

Setting connectionPool crashes Slick 3.0

假如想象 提交于 2019-12-11 13:41:27
问题 I'm using Slick 3.0 with MySql and I'm getting terrible performance, which I want to tune. I initialize the database with val db = Database.forConfig("horridDBStuff") Then in application.conf I have horridDBStuff = { url = "jdbc:mysql://my.db.address:3306/myschema" driver = "com.mysql.jdbc.Driver" connectionPool = disabled keepAliveConnection = true properties = { user = "me" password = "me" } } Slick documentation says that in deployment you should enable the connection pool, so that's what

Hibernate > 3.3 and c3p0

烂漫一生 提交于 2019-12-11 12:52:44
问题 As c3p0 does not seem to be bundled with Hibernate anymore (as of versions > 3.3, I am using Hibernate 3.6.0), I'd like to know how to integrate c3p0 with Hibernate. Obviously the old approach with <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> does not seem to work anymore, as the class C3P0ConnectionProvider is not provided by Hibernate anymore. Do I now have to build this on my own or is it safe to integrate the hibernate-c3p0-3.3.x

JDBC connection leak on JDBC pool when using AQ

不想你离开。 提交于 2019-12-11 12:20:41
问题 We are using the Oracle AQ support from spring-data to have both JMS and JDBC over the same datasource, with local transactions instead of XA. The big picture of our setup is basically what is described in the reference manual:on the orcl:aq-jms-connection-factory: use-local-data-source-transaction="true" and native-jdbc-extractor="oracleNativeJdbcExtractor" HibernateTransactionManager (I am trying to use single DataSource(DBCP2 basic datasource) now for AQ and Hibernate).I am using camel JMS

Configuring c3p0 property initialPoolSize and maxStatements using Hibernate

亡梦爱人 提交于 2019-12-11 12:08:09
问题 I am using Hibernate and I have configured some c3p0 properties in its config as specified in one of the hibernate documentation. Sample configuration looks like : <property name="hibernate.c3p0.min_size">5</property> <property name="hibernate.c3p0.max_size">20</property> <property name="hibernate.c3p0.timeout">300</property> <property name="hibernate.c3p0.max_statements">50</property> <property name="hibernate.c3p0.idle_test_period">3000</property> I came to know that c3p0 has many other