コード例 #1
0
ファイル: CMTTest.java プロジェクト: ChanBowei/hibernate-orm
 @Override
 protected void addSettings(Map settings) {
   TestingJtaBootstrap.prepare(settings);
   // settings.put( AvailableSettings.TRANSACTION_STRATEGY, CMTTransactionFactory.class.getName()
   // );
   settings.put(
       AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY,
       JtaTransactionCoordinatorBuilderImpl.class.getName());
   settings.put(AvailableSettings.AUTO_CLOSE_SESSION, "true");
   settings.put(AvailableSettings.FLUSH_BEFORE_COMPLETION, "true");
   settings.put(
       AvailableSettings.RELEASE_CONNECTIONS, ConnectionReleaseMode.AFTER_STATEMENT.toString());
   settings.put(AvailableSettings.GENERATE_STATISTICS, "true");
   settings.put(AvailableSettings.USE_QUERY_CACHE, "true");
   settings.put(AvailableSettings.CACHE_REGION_PREFIX, "");
   settings.put(AvailableSettings.DEFAULT_ENTITY_MODE, EntityMode.MAP.toString());
 }
コード例 #2
0
 public void configure(Configuration cfg) {
   cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "false");
   cfg.setProperty(Environment.GENERATE_STATISTICS, "true");
   cfg.setProperty(Environment.DEFAULT_ENTITY_MODE, EntityMode.MAP.toString());
 }