自定义隔离级别如何启用为的DataSourceTransactionManager隔离级别的定制?设置的DataSourceTransactionManager
我在Spring配置文件以下。
<bean id="transactionManager"class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="myDataDource"/>
</bean>
<bean id="myTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true" lazy-init="false" autowire="default" dependency-check="default">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="cancel">PROPAGATION_REQUIRED,ISOLATION_READ_UNCOMMITTED,timeout_25,-Exception</prop>
</props>
</property>
</bean>
但是当我尝试运行它时,它给了我以下错误。
org.springframework.transaction.InvalidIsolationLevelException: JtaTransactionManager does not support custom isolation levels by default - switch 'allowCustomIsolationLevels' to 'true'
我不使用JtaTransactionManager来,为什么我得到了这个警告? 如何为DataSourceTransactionManager启用自定义隔离级别?在文档中,有人提到这个类将支持自定义隔离级别,但我没有在网上找到任何示例。它大部分仅用于JtaTransactionManager。只是想知道有没有人能帮我解决这个问题。谢谢。