[transaction] compatibility of ResourceManager to XAResource interface

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[transaction] compatibility of ResourceManager to XAResource interface

Joerg Heinicke
When following the JTA 1.0.1B spec [1] while implementing my resource adapter
(XAResource) around the Commons Transaction FileResourceManager I came across
another issue:

XAResource has a method "public Xid[] recover(int flag)". Following is written
in the spec's section "3.4.8 Failures recovery":

"For each resource manager, the Transaction Manager uses the XAResource.recover
method to retrieve the list of transactions that are currently in a prepared or
heuristically completed state. [..] Because XAResource objects are not
persistent across system failures, the Transaction Manager needs to have some
way to acquire the XAResource objects that represent the resource managers which
might have participated in the transactions prior to the system failure. For
example, a Transaction Manager might, through the use of the JNDI lookup
mechanism and cooperation from the application server, acquire an XAResource
object representing each of the Resource Manager configured in the system. The
Transaction Manager then invokes the XAResource.recover method to ask each
resource manager to return any transactions that are currently in a prepared or
heuristically completed state. It is the responsibility of the Transaction
Manager to ignore transactions that do not belong to it."

This means I need a way to retrieve a list of transaction IDs to be recovered,
which the Commons Transaction ResourceManager interface does not provide at the
moment. Its recover() method does not provide it. Would it be possible to change
the method though this changes the interface?

J�rg

[1] http://java.sun.com/products/jta/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [transaction] compatibility of ResourceManager to XAResource interface

Oliver Zeigermann
They are all present as keys in

globalTransactions

after recovery which is done at startup automatically. It would be
very easy to add a method that simply returns an accumulated list of
them.

Oliver

2005/11/15, Joerg Heinicke <[hidden email]>:

> When following the JTA 1.0.1B spec [1] while implementing my resource adapter
> (XAResource) around the Commons Transaction FileResourceManager I came across
> another issue:
>
> XAResource has a method "public Xid[] recover(int flag)". Following is written
> in the spec's section "3.4.8 Failures recovery":
>
> "For each resource manager, the Transaction Manager uses the XAResource.recover
> method to retrieve the list of transactions that are currently in a prepared or
> heuristically completed state. [..] Because XAResource objects are not
> persistent across system failures, the Transaction Manager needs to have some
> way to acquire the XAResource objects that represent the resource managers which
> might have participated in the transactions prior to the system failure. For
> example, a Transaction Manager might, through the use of the JNDI lookup
> mechanism and cooperation from the application server, acquire an XAResource
> object representing each of the Resource Manager configured in the system. The
> Transaction Manager then invokes the XAResource.recover method to ask each
> resource manager to return any transactions that are currently in a prepared or
> heuristically completed state. It is the responsibility of the Transaction
> Manager to ignore transactions that do not belong to it."
>
> This means I need a way to retrieve a list of transaction IDs to be recovered,
> which the Commons Transaction ResourceManager interface does not provide at the
> moment. Its recover() method does not provide it. Would it be possible to change
> the method though this changes the interface?
>
> Jörg
>
> [1] http://java.sun.com/products/jta/index.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]