Java Pseudo Transactions With Non-Transactional Resources
Enterprise Java Community: Java Pseudo Transactions With Non-Transactional Resources
- 把non-transactional resource和transactional resource放在一个事务中,就是把对non-transactional resource的操作放在最后。
很土的一个方式,原来也是这么做的,只是没总结出来。 - post by lithium
- 把non-transactional resource和transactional resource放在一个事务中,就是把对non-transactional resource的操作放在最后。
- By putting the interaction with the non-transactional
resource as the final action in the transaction, we limit the chance of error
occurring after interaction with the non-transactional resource - in a pseudo-transaction that has any number of interactions
with transactional resources and a single interaction with a non-transactional
resource, make the non-transactional interaction the final activity in the
pseudo-transaction. - To achieve a pseudo transaction, we encapsulate each non-transactional interaction
into a Command object. In each Command object, we implement a rollback method,
which is called if a rollback of the pseudo-transaction occurs sometime after
the Command has been executed.
Posted from Diigo. The rest of my favorite links are here.
没有评论:
发表评论