Hi!
> -----Ursprungligt meddelande-----
> Fr�n: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]F�r Rickard �berg
> Skickat: den 13 juni 2000 13:11
> Till: jBoss Developer
> �mne: Re: [jBoss-Dev] Transactions, please!
>
>
> Hi!
>
> Tommy Hellstr�m wrote:
> > > I think that if the sub-TM is added as a XAResource to the top-TM this
> > > will work out by way of recursion. First of all, if the sub-TM dies,
> > > then the top-TM *have to* rollback (by using .forget calls to all
> > > XAResources).
> >
> > I don't think that is the case cause the top-TM can send out
> COMMIT to other
> > participant before it gets an exception from the failing sub-TM.
>
> Then the usual recovery protocol should be used: call recover() on the
> sub-TM XAResource. Doesn't that make sense? Or is there some reason I am
> missing why sub-TM's should not be treated as XAResources?
No, I think they should be treated as a Resource manager. But in the case
when a sub-TM dies I think the sub-TM will do its own recovery before the
top-TM gets a chance to call recover(). OTS solves this by storing a
RecoveryCoordinator in stable storage at PREPARE state to be able to use
that reference during recovery. I think that's one way to solve the problem.
When thinking about it the sub-TM might wait for the top-TM to call recover
and let the top-TM handle the recovery. In the latter case you are right.
> > I think
> > forget() should be used to notify a resource, that earlier has made a
> > heuristic decision and after that thrown a heuristic exception,
> to forget
> > about it.
>
> I would say that if all prepare()'s went well and an error occurs during
> commit phase, then use recover(). However if an error occurs during the
> prepare phase then the tx must rollback, and hence forget() is used
> instead. That seems reasonable, but I might be wrong.
That seems good.
/Tommy