Two Phase commit-How to test
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.
精彩评论