I don't understand the point you're making.
I'm taking "heuristic commit/rollback example" as listed in the wiki page. So for this example I need to figure out what to show to the users about heuristic scenario -- get a heuristic exception thrown and handle it by forget() call. So I need to create a scenario with JBM XASession where the xa commit() on XAResource can throw a heuristic exception. Then I'll tell the xa resource to forget about this transaction.
I investigated out code and found it's not possible to simulate this process. So probably we drop this example for the moment?
That's not the the purpose of the heuristic XA example.
With this example the idea is to
a) Start and prepare one or more transactions, do not commit or roll them back yet.
b) List the transactions in prepared state.
c) Heuristically roll back or commit, via the management interface
The Heuristic API was prepared for a Human. That means:
- You list the XIDs...
- You read the report...
- You type (or copy & paste) the XID String
- You call the method on an admin console.
Doing that on an example is going to be a challenge... unless you give instructions to the user on how to interact with the Console, which would be a good idea.
OK, I understand now. Thanks Tim/Clebert.