title: openJPA's persistence.xml configuration
body: <p>Earlier in my project I was using a combination of Hibernate 3.3.2, openJPA 2.1.1 to connect to the database and retrieve the information from table. Now I want to remove Hibernate and use openJPA for doing connection and retrieving the information.</p>
  
  <p>My earlier configuration of persistence.xml was</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_2_0.xsd"&gt;
  &lt;persistence-unit name="test" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
        &lt;properties&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/&gt;
          &lt;property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="hibernate.connection.provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider&lt;/property&gt;
          &lt;property name="hibernate.connection.url" value="jdbc:mysql://10.10.10.10:3306/test?autoReconnect=true"/&gt;
          &lt;property name="hibernate.connection.username" value="user"/&gt;
          &lt;property name="hibernate.connection.password" value="pwd"/&gt;
          &lt;property name="hibernate.generate_statistics" value="true"/&gt;
          &lt;property name="hibernate.cache.provider_class" value="org.hibernate.cache.OSCacheProvider"/&gt;
          &lt;property name="hibernate.cache.use_second_level_cache" value="true"/&gt;
          &lt;property name="hibernate.show_sql" value="true"/&gt;
          &lt;property name="hibernate.format_sql" value="true"/&gt;
          &lt;property name="hibernate.c3p0.min_size" value="5"/&gt;
          &lt;property name="hibernate.c3p0.max_size" value="20"/&gt;
          &lt;property name="hibernate.c3p0.timeout" value="1800"/&gt;
          &lt;property name="hibernate.c3p0.max_statements" value="50"/&gt;
          &lt;property name="hibernate.c3p0.idle_test_period" value="1800"/&gt;
          &lt;property name="c3p0.idleConnectionTestPeriod" value="1810"/&gt;
        &lt;/properties&gt;
     &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Now I want to move to openJPA 2.1.1 and for that my persistence.xml file is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
  &lt;persistence-unit name="TestOpenJPAPersistence" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
      &lt;properties&gt;
          &lt;property name="javax.persistence.jdbc.url" value="jdbc:mysql://10.10.10.10:3306/test?autoReconnect=true"/&gt;
          &lt;property name="javax.persistence.jdbc.user" value="user"/&gt;
          &lt;property name="javax.persistence.jdbc.password" value="pwd"/&gt;
          &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="openjpa.ConnectionFactoryProperties" value="MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=1800000"/&gt;
          &lt;property name="openjpa.Log" value="File=E:\\temp\\TestOpenJPAPersistence\\org.apache.openjpa.log, DefaultLevel=DEBUG, Runtime=INFO, Tool=INFO, SQL=TRACE"/&gt;
          &lt;property name="openjpa.jdbc.DBDictionary" value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/&gt;
          &lt;property name="openjpa.DataCache" value="true"/&gt;
          &lt;property name="openjpa.QueryCache" value="true"/&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>My question is what are the replacement property for following hibernate property in openJPA</p>
  
  <pre><code>&lt;property name="hibernate.connection.provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider&lt;/property&gt;
  &lt;property name="hibernate.cache.provider_class" value="org.hibernate.cache.OSCacheProvider"/&gt;
  &lt;property name="hibernate.cache.use_second_level_cache" value="true"/&gt;
  &lt;property name="hibernate.show_sql" value="true"/&gt;
  &lt;property name="hibernate.format_sql" value="true"/&gt;
  &lt;property name="hibernate.c3p0.min_size" value="5"/&gt;
  &lt;property name="hibernate.c3p0.max_size" value="20"/&gt;
  &lt;property name="hibernate.c3p0.timeout" value="1800"/&gt;
  &lt;property name="hibernate.c3p0.max_statements" value="50"/&gt;
  &lt;property name="hibernate.c3p0.idle_test_period" value="1800"/&gt;
  </code></pre>
  
  <p></p>