I am getting some unexpected behaviour when testing the distributed
resource recovery functionality in Java Edition.
As I understand it, a prepared but not committed or rolledback
transaction should stay in the recovery list. The X/Open standard
"Two consecutive complete recovery scans return the same list of
transaction branches unless a transaction manager calls xa_commit(),
xa_forget(), xa_prepare(), or xa_rollback() for that resource manager,
or unless that resource manager heuristically completes some branches,
between the two recovery scans."
I don't really understand the heuristic part, so perhaps that is my
prolem, but as I read it a prepared transaction should come up again
and again until I do something with it.
Please see the attached test program. This contains code to prepare
but not complete a transaction, and code to count the number of
transactions pending recover. This gives me the following results: