开发者

Two Phase commit-How to test

开发者 https://www.devze.com 2023-02-06 03:32 出处:网络
We are trying to implement two phase commit on a Java/Jboss/Apache environment. However we have difficulty understanding how we can testthat it actually works?

We are trying to implement two phase commit on a Java/Jboss/Apache environment.

However we have difficulty understanding how we can test that it actually works? are there any gui tools th开发者_高级运维at can help us test it?

Thanks


I can think of couple of scenarios

  • unplug once of the resources participating in a 2PC. my favorite
  • let one of the db operations fail with integrity constraint

The transaction should rollback.


I'd consider adding some hooks to your application to force a failure at each stage one by one; so you can check the expected outcome.

Or use unit testing if thats easier.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号