Disable « Connection « JPA Q&A





1. Disable connection pooling    forum.hibernate.org

Just set "hibernate.pool_size" parameter to zero. Hibernate internal pool is very simple. It only checks this value when connection needs to be closed. So, if number of opened connections is not larger than "hibernate.pool_size" it retains connection in the open state. Setting the parameter to zero resolves this issue. It is not possible to turn off the pooling at all (except ...

2. hibernate caching disabled if you supply a connection    forum.hibernate.org

Hibernate 2.1.1 EHCache enabled I noticed that hibernate caching is disabled if you supply the connection to the openSession() method on the SessionFactory. Code: Connection con = ; SessionFactory sf = ; Session sess = sf.openSession(con); Looking through the source code, I noticed the following Code: private Session openSession(Connection connection, boolean autoClose, long timestamp, Interceptor interceptor) { ...

3. Disable connection pooling or connecting to db with bad netw    forum.hibernate.org

Hibernate version: 3.0 Code between sessionFactory.openSession() and session.close(): Name and version of the database you are using: MySQL The generated SQL (show_sql=true): Debug level Hibernate log excerpt: 14:47:27,895 INFO [STDOUT] com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1902) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2348) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2858) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:2972) at com.mysql.jdbc.Connection.execSQL(Connection.java:2902) at ...

4. Connection Cache with this Cache Name is Disabled    forum.hibernate.org

Hello: I am getting the following exception while using Hibernate 3.2.6 on a small web-app running on OC4J 10.1.3.0.0 (more following exception): org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326) at business.PersistMemberListServlet.doPost(PersistMemberListServlet.java:48) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713) at com.evermind[Oracle Containers ...