0
私はスプリングブートを使用しており、デフォルトの隔離レベルをREAD_UNCOMMITTED
に変更したいとします。隔離レベルを変更する - hibernate.connection.isolationが機能しない
プロパティを検索したところ、hibernate.connection.isolation
が見つかりましたが、試してみましたが、動作しませんでした。
私の構成はこれです:
private Properties additionalJpaProperties() {
Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "validate");
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.SQLServerDialect");
properties.setProperty("hibernate.connection.isolation", String.valueOf(Connection.TRANSACTION_READ_UNCOMMITTED));
return properties;
}
@Primary
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) throws SQLException {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource);
em.setPackagesToScan(this.packages);
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(this.additionalJpaProperties());
return em;
}
は、どのように私は春のブートを使用して分離レベルを変更できますか?