Neo4jTransactionManager 不允许支持自定义隔离级别
Neo4jTransactionManager is not allowed to support custom isolation levels
当 jpa 方法存在自定义隔离级别时会发生这种情况 (isolation = Isolation.SERIALIZABLE)。
@Override
@Transactional(readOnly=false, isolation = Isolation.SERIALIZABLE)
public Lis saveAll(List<Price> prices) {
..
}`
不确定是否是 ChaniedTransactionManager 的原因?如果是这样,我可以分开交易管理器吗?
事务管理器
@Bean(name = "transactionManager")
public PlatformTransactionManager transactionManager(){
return new ChainedTransactionManager(new JpaTransactionManager(entityManagerFactory().getObject()),
new Neo4jTransactionManager(sessionFactory));
}
Neo4j 本身只支持读提交隔离级别。来自 documentation:
5.2. Isolation levels
Transactions in Neo4j use a read-committed isolation level, which means they will see data as soon as it has been committed and will not see data in other transactions that have not yet been committed.
这就是 Spring Data Neo4j 仅支持默认隔离级别的原因。 From the documentation:
SDN only supports PROPAGATION_REQUIRED and ISOLATION_DEFAULT type transactions.
当 jpa 方法存在自定义隔离级别时会发生这种情况 (isolation = Isolation.SERIALIZABLE)。
@Override
@Transactional(readOnly=false, isolation = Isolation.SERIALIZABLE)
public Lis saveAll(List<Price> prices) {
..
}`
不确定是否是 ChaniedTransactionManager 的原因?如果是这样,我可以分开交易管理器吗?
事务管理器
@Bean(name = "transactionManager")
public PlatformTransactionManager transactionManager(){
return new ChainedTransactionManager(new JpaTransactionManager(entityManagerFactory().getObject()),
new Neo4jTransactionManager(sessionFactory));
}
Neo4j 本身只支持读提交隔离级别。来自 documentation:
5.2. Isolation levels
Transactions in Neo4j use a read-committed isolation level, which means they will see data as soon as it has been committed and will not see data in other transactions that have not yet been committed.
这就是 Spring Data Neo4j 仅支持默认隔离级别的原因。 From the documentation:
SDN only supports PROPAGATION_REQUIRED and ISOLATION_DEFAULT type transactions.