java - Is Hibernate also use connection pool as JDBC? -
I use the JBOSS 7.1 web server for my application. I configured the JBOSS connection pool and used it for a JDBC connection Used. I also want to use Hibernate in my application and I want to know whether to use Hibernate or this connection pool, or do I need to configure another connection pool (for example c3p0) to be hibernate?
hibernate.cfg.xml
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! DOCTYPE Hibernate-Configuration PUBLIC "- // Hibernate / Hibernate Configuration DTD 3.0 / N" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> & Lt; Hibernate-configuration & gt; & Lt; Session-Factory & gt; & Lt; Property Name = "hibernate.connection.driver_class" & gt; Oracle.jdbc.driver.OracleDriver & lt; / Property & gt; & Lt; Property name = "hibernate.conction.url" & gt; JDBC: Oracle: thin: @ localhost: 1521: schema & lt; / Property & gt; & Lt; Property Name = "hibernate.connection.username" & gt; Users & lt; / Property & gt; & Lt; Property Name = "hibernate.connection.password" & gt; Password & lt; / Property & gt; & Lt; Property Name = "hibernate.dialect" & gt; Org.hibernate.dialect.Oracle10gDialect & lt; / Property & gt; & Lt; Property Name = "hibernate.default_schema" & gt; Schema & lt; / Property & gt; & Lt; Property Name = "show_sql" & gt; True & lt; / Property & gt; & Lt; Property Name = "hibernate.c3p0.min_size" & gt; 5 & lt; / Property & gt; & Lt; Property Name = "hibernate.c3p0.max_size" & gt; 20 & lt; / Property & gt; & Lt; Property Name = "hibernate.c3p0.timeout" & gt; 300 & lt; / Property & gt; & Lt; Property Name = "hibernate.c3p0.max_statements" & gt; 50 & lt; / Property & gt; & Lt; Property Name = "hibernate.c3p0.idle_test_period" & gt; 3000 & lt; / Property & gt;
hibernate.c3p0.min_size one ???? Hibernate at least the JDBC connection in the pool: 1 Hibernate. Cp3p0.max_size Hibernate the maximum number of JDBC connections in a pool: 100 hibernate .3p0. Time expired when a passive connection is removed from the pool (in the other) Hibernate default: 0, can never end at hibernate .3p0.max_statements a ???? The number of ready statements will be cached. increase performance. Hibernate default: 0, caching is disabled. Hibernate c3p0.idle_test_period a ???? Idle time in seconds before a connection is automatically validated. Default hibernate: 0 See more details
Comments
Post a Comment