尝试在项目中激活快照事务隔离模式。 数据库仍将事务视为READ_COMMITED。 正确的设置是什么?
环境:
已完成的操作:
在数据库上:
ALTER DATABASE db SET ALLOW_SNAPSHOT_ISOLATION ON
在项目配置中:将<property name="hibernate.connection.isolation" value="4096"/>
添加到persistence.xml
有关配置的更多信息:
wildfly / java配置:
[domain@localhost:9990 /] version
JBoss Admin Command-line Interface
JBOSS_HOME: /opt/JBOSS/wildfly-10.1.0.Final
JBoss AS release: 2.2.0.Final "Kenny"
JBoss AS product: WildFly Full 10.1.0.Final
JAVA_HOME: null
java.version: 1.8.0_191
java.vm.vendor: Oracle Corporation
java.vm.version: 25.191-b12
os.name: Linux
os.version: 4.4.0-116-generic
wilddly domain.xml配置文件
<subsystem xmlns="urn:jboss:domain:datasources:4.0">
<datasources>
<datasource jta="true" jndi-name="java:/MSSQLDS" pool-name="MSSQLDS" enabled="true" use-ccm="true">
<connection-url>jdbc:sqlserver://dev-project.domain.local:1433;DatabaseName=db</connection-url>
<driver>sqlserver</driver>
<transaction-isolation></transaction-isolation>
<pool>
<min-pool-size>20</min-pool-size>
<max-pool-size>500</max-pool-size>
<prefill>true</prefill>
<flush-strategy>Gracefully</flush-strategy>
</pool>
<security>
<user-name>projadmin</user-name>
<password>projadmin</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>
<background-validation>true</background-validation>
</validation>
</datasource>