Hibernate connection pool configuration
Advertisements
<! - Jdbc ->
<property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property>
<property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.132:1521: remotedb </ property>
<property name="dialect"> org.hibernate.dialect.Oracle9Dialect </ property>
<property name="myeclipse.connection.profile"> oracledriver </ property>
<property name="connection.username"> imagedb </ property>
<property name="connection.password"> cpic </ property>
<! - C3P0 ->
<property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property>
<property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.132:1521: remotedb </ property>
<property name="dialect"> org.hibernate.dialect.Oracle9Dialect </ property>
<property name="myeclipse.connection.profile"> oracledriver </ property>
<property name="connection.username"> imagedb </ property>
<property name="connection.password"> cpic </ property>
<property name="hibernate.connection.provider_class">
org.hibernate.connection.C3P0ConnectionProvider </ property>
<property name="hibernate.c3p0.max_size"> 20 </ property>
<property name="hibernate.c3p0.min_size"> 5 </ property>
<property name="hibernate.c3p0.timeout"> 120 </ property>
<property name="hibernate.c3p0.max_statements"> 100 </ property>
<property name="hibernate.c3p0.idle_test_period"> 120 </ property>
<property name="hibernate.c3p0.acquire_increment"> 20 </ property>
<! - Proxool ->
<! - The name to the above XML document and an alias to the corresponding ah ->
<property name="connection.provider_class">
org.hibernate.connection.ProxoolConnectionProvider </ property>
<property name="proxool.pool_alias"> imagePool </ property>
<! - This you have just set up above the name of the XML document ->
<property name="proxool.xml"> ProxoolConf.xml </ property>
<property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property>
ProxoolConf.xml
<? xml version = "1.0" encoding = "utf-8"?>
<! - The proxool configuration can be embedded within your own application's.
Anything outside the "proxool" tag is ignored. ->
<something-else-entirely>
<proxool>
<! - Connection pool Writing can be an alias, but noted that the back part to correspond in hibernate ->
<alias> imagePool </ alias>
<! - proxool can only be managed by the connection itself ->
<driver-url> jdbc: oracle: thin: @ 10.203.14.132:1521: remotedb </ driver-url>
<driver-class> oracle.jdbc.driver.OracleDriver </ driver-class>
<driver-properties>
<property name="user" value="imagedb"/>
<property name="password" value="cpic"/>
</ driver-properties>
<! - Proxool automatically detect the connection status of each time interval (milliseconds), detected idle connections as soon as recovery, the destruction of overtime ->
<house-keeping-sleep-time> 90000 </ house-keeping-sleep-time>
<! - Means no idle connection can be allocated in the queue waiting for the greatest number of requests, more than the requested number of users connected will not be accepted ->
<maximum-new-connections> 20 </ maximum-new-connections>
<! - At least to keep the idle connections ->
<prototype-count> 5 </ prototype-count>
<! - Permit the largest number of connections over the connection, and then have a request, on the row in the queue waiting, waiting for the biggest number of requests by the maximum-new-connections decided ->
<maximum-connection-count> 100 </ maximum-connection-count>
<! - The smallest number of connections ->
<minimum-connection-count> 10 </ minimum-connection-count>
<! - Wait for the largest number of requests, that is because there is no idle connection can be allocated in the queue waiting for the greatest number of requests, more than the requested number of user connections will not be accepted ->
<proxool.simultaneous-build-throttle> 200 </ proxool.simultaneous-build-throttle>
<! - Test SQL (SELECT getDate ()) ->
<house-keeping-test-sql> select CURRENT_DATE </ house-keeping-test-sql>
</ proxool>
</ something-else-entirely>
This is proxool-0.8.3 version turn off when the abnormal
18:08:54703 INFO imagePool: 474 - Shutting down 'imagePool' pool immediately [Shutdown Hook]
18:08:54750 ERROR ShutdownHook: 62 - Problem calling "get cause" on IllegalStateException.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
at java.lang.reflect.Method.invoke (Unknown Source)
at org.logicalcobwebs.proxool.ShutdownHook.remove (ShutdownHook.java: 40)
at org.logicalcobwebs.proxool.ProxoolFacade.shutdown (ProxoolFacade.java: 238)
at org.logicalcobwebs.proxool.ProxoolFacade.shutdown (ProxoolFacade.java: 220)
at org.logicalcobwebs.proxool.ShutdownHook.run (ShutdownHook.java: 99)
at java.lang.Thread.run (Unknown Source)
Caused by: java.lang.IllegalStateException: Shutdown in progress
at java.lang.Shutdown.remove (Unknown Source)
at java.lang.Runtime.removeShutdownHook (Unknown Source)
... 9 more
Proposed proxool-0.9.1.jar
Official Address: http://proxool.sourceforge.net/changelog.html
Related Posts of Hibernate connection pool configuration
-
JAVA EE JSP_JNDI
dsfdsa http://lindows.javaeye.com/admin/blogs/213348 Tomcat 6 with the connection pool data source configuration http://www.blogjava.net/ec2008/archive/2008/07/19/216063.html project: test Driver path: D: \ workspace \ test \ WebRoot \ WEB-INF \ lib ...
-
Hibernate.cfg.xml configuration file (including the primary key generation strategy Introduction)
Hibernate.cfg.xml configuration file: <? xml version = "1.0" encoding = "utf-8"?> <! DOCTYPE hibernate-configuration PUBLIC "- / / Hibernate / Hibernate Configuration DTD / / EN" "hibernate-configuration-2.0.dtd
-
The EJB3 Persistence
EJB3 persistence with Hibernate is very similar to the mechanism: Environment: Server: JBOSS5.0 Database: MySQL5.0 1. Set up a data source First of all, in jboss-5.0.0.GA \ server \ default \ deploy, the establishment of a database used to connect the dat
-
hibernate generic generic DAO
package org.lzpeng.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *
-
spring struts2.0 hibernate environmental structures .. despair carried out more than one hour only with good.
http://www.qqread.com/java/2008/06/f413762.html Look here. . Note added myeclipse support spring when necessary add the commons-dbcp database connection pool package. And to add hibernate support. . Finally add struts2 support. . Oh the lazy point. . . fu
-
Struts2 + hibernate + spring problem user log in
dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q
-
Hibernate secondary cache
Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...
-
Hibernate's lazy strategy
hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...












