Eclipselink连接池是否可用于生产?

时间:2017-01-18 09:00:45

标签: eclipselink

我目前正在尝试与eclipselink一起使用不同的连接池。我目前正在配置的是eclipselink本身。现在我不确定它是用于生产还是我应该使用另一种如HikariCP?此外,我不知道如何检测Eclipselink连接池是否真的在运行。我的配置如下:

的persistence.xml

...
      <!-- Configuring Eclipse Link -->
      <property name="javax.persistence.jdbc.driver"          value="net.sourceforge.jtds.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.url"             value="jdbc:jtds:sqlserver://SERVER/dev;instance=MSSQL2008R2"/>
      <property name="javax.persistence.jdbc.user"          value="user"/>
      <property name="javax.persistence.jdbc.password"      value="password"/>
      <property name="eclipselink.persistence-context.flush-mode" value="commit" /> <!-- Flushing occurs at transaction commit. (https://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/p_persistence_context_flushmode.htm)-->

      <!-- We use the EclipseLink internal components (https://www.eclipse.org/eclipselink/documentation/2.6/jpa/extensions/persistenceproperties_ref.htm)-->
      <!-- Eclipselink jdbc configuration -->
      <property name="eclipselink.jdbc.batch-writing" value="JDBC"/> <!-- Batch-writing is supported by mssql and our jdbc driver (https://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/p_jdbc_batchwriting.htm) -->
 <!-- <property name="eclipselink.jdbc.batch-writing.size" value="10000"/>  --> <!--Performance testing http://java-persistence-performance.blogspot.ch/2013/05/batch-writing-and-dynamic-vs.html -->
      <property name="eclipselink.jdbc.bind-parameters" value="true"/> <!-- Parameterized sql queries -->
      <property name="eclipselink.jdbc.cache-statements" value="true"/> <!-- https://docs.oracle.com/middleware/1212/core/ASPER/toplink.htm#ASPER99838 -->
      <property name="eclipselink.jdbc.cache-statements.size" value="10000"/>
      <property name="eclipselink.jdbc.allow-native-sql-queries" value="false"/> <!-- We explicitly set this, even though it is disabled by multitenancy by default -->

      <!-- Eclipselink connection pool configuration-->
      <property name="eclipselink.connection-pool.default.initial" value="50" />
      <property name="eclipselink.connection-pool.default.min" value="50"/>
      <property name="eclipselink.connection-pool.default.max" value="100"/>
      <property name="eclipselink.connection-pool.default.url" value="jdbc:jtds:sqlserver://SERVER/dev;instance=MSSQL2008R2"/>

      <!-- Eclipselink cache configuration -->
      <property name="eclipselink.cache.shared.default" value="true" />

      <!-- Eclipselink logging configuration -->
      <property name="eclipselink.logging.level" value="OFF"/> <!-- How much log should be shown | from: https://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging#Log_Level_Configuration-->
      <property name="eclipselink.logging.level.sql" value="OFF"/> <!-- How to show the sql queries -->

      <property name="eclipselink.target-database" value="SQLServer"/> <!-- What sql database is used | from: http://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/p_target_database.htm-->
      <property name="eclipselink.ddl-generation" value="none"/>
      <property name="eclipselink.session.customizer" value="platform.data.EclipseLinkSessionCustomizer"/> <!-- Defines a naming strategy  -->
      <property name="eclipselink.multitenant.tenants-share-emf" value="false"/>
 ...

感谢您的帮助!

0 个答案:

没有答案