项目中需要使用到嵌套事务,有哪位大用org.springframework.orm.hibernate3.HibernateTransactionManager这个事务管理器做过嵌套事务(nested)的吗??
或者是有其他方式做过嵌套事务方面的业务吗? 求个DEMO参考一下。
下面是这个HibernateTransactionManager源码的注释:
On JDBC 3.0, this transaction manager supports nested transactions via JDBC 3.0 Savepoints. ThesetNestedTransactionAllowed"nestedTransactionAllowed"} flag defaults to "false", though, as nested transactions will just apply to the JDBC Connection, not to the Hibernate Session and its cached objects. You can manually set the flag to "true" if you want to use nested transactions for JDBC access code which participates in Hibernate transactions (provided that your JDBC driver supports Savepoints). Note that Hibernate itself does not support nested transactions! Hence, do not expect Hibernate access code to semantically participate in a nested transaction.