On Thu, May 31, 2001 at 03:16:12PM -0400, Anatoly Akkerman wrote:
> On Thu, 31 May 2001, Toby Allsopp wrote:
>
> > On Wed, May 30, 2001 at 07:19:26PM -0400, Anatoly Akkerman wrote:
> > >
> > > I am running into problems with JBoss pools and Tyrex. This time it is a
> > > 2pc hueristic commit issue.
> >
> > Great. A wurble-munging wickety booger.
>
> I guess I was not clear enough. Tyrex is a DTM from exolab.org which I
> integrated with JBoss and committed into CVS a week ago. (check out
> org.jboss.tm.plugins.tyrex)
Sorry, I was just commenting on the fact that I know next to nothing
about how heuristics are supposed to work in JTA. I understand the gist
of the problem you're describing.
> The issue is using jboss pools in a distributed transaction (in my case,
> I've split the Petstore into pieces and deployed on several JBoss servers
> to test distributed transactions for my project)
>
> I've experienced transaction rollbacks under certain deployment scenarious
> and when I tracked down where they were coming from, it happened to be the
> minerva module. The scenario is as follows:
>
> 3 jboss servers
>
> server1: a bean initiates a transaction and in the context of this
> transaction calls beans on server2 and server3
>
> server2: bean accesses a local datasource (minerva-wrapped
> cloudscape db) modifies some data
>
> server3: bean accesses a local datasource (minerva-wrapped cloudscape
> db) and modifies data
>
> server1: tries to commit the transaction, causing commit on the
> subtransactions in the server2 and server3 and their respective
> datasources
Ok, gotcha. I think Minerva should be fine with that (so this is a bug
somewhere).
> (more below)
>
> > Are you talking about Minerva's XADataSource implementation
> > (org.jboss.pool.jdbc.xa.wrapper.XA*)?
> >
>
> Yes, indeed.
> (more below)
>
> > This implementation is just a wrapper for non-XA JDBC drivers so that they
> > can participate in transactions managed by a JTA transaction manager. It
> > doesn't magically give these drivers the ability to handle 2pc correctly.
> >
> > I'm not sure what scenario exactly you're testing, but if you're using the
> > wrappers then you should not have more than one resource enlisted in the
> > transaction.
> >
> > > Tyrex upon getting successful commits from the XAResources, being in 2pc
> > > sets heuristic to COMMIT and asks the XAResources to forget() the
> > > transaction.
> >
> > I don't understand what JTA is talking about with "heuristic" this and
> > that. It seems like a mechanism for dealing with strange situations or
> > something.
> >
> > What is Tyrex trying to achieve with this heuristic stuff? What do you
> > mean by "sets heuristic to COMMIT"?
> >
>
> On a 2pc Tyrex DTM the originator transaction (sitting on server1) asks
> its subordinate transactions (on server2 and server3) to commit.
>
> The subordinate transactions (on server2 and server3) call commit() on
> their datasources and return their votes to the main coordinator. The
> coordinator based on the votes takes a heuristic decision on what to do
> about the completion of this transaction. If there were no errors
> reported, the TM decides to complete the commit heuristically. So, it does
> not throw any exceptions, but tries to tell all the subordinates to
> forget() the transaction. This indicated that the last request (commit())
> was accepted by everybody and everybody can now forget about this
> transaction.
I don't see how this can work. What happens if one of the subtransactions
fails? I would have thought that the originator would need to use some
kind of two-phase protocol to make sure that all of the subtransactions
are prepared successfully before asking any of them to commit.
> So, it comes out that the XAResource should expect to see a
> commit() followed by forget() in such a scenario.
My current opinion is that that's an unreasonable thing for the transaction
manager to do. My admittedly sketchy and hurriedly acquired understanding
of what forget() is for tells me that forget() should only be called on a
resource that has reported a heuristic.
Is there a distributed transaction expert in the house?
> Minerva code seems not to support this type of scenario. First, on a
> commit() of minerva XAResource the current is set to null. And second,
> even if we delay setting current to null till forget() is called,
> forget() calls the underlying jdbc connection saying something about
> transaction failing, which is not true in this particular case.
That seems like an incorrect interpretation of forget, I agree. I'm not
able to really look into it right now, however.
> > This may well be a problem with Minerva/JBossPool, but the wrappers really
> > aren't meant to handle anything complicated.
>
> I am no JDBC/transactions guru, I've implemented the tyrex module and
> planning to use it for my research, so if Minerva is inherently incapable
> of handling these types of scenarios, I'll go ahead and get Oracle or
> something that can handle it. I was just wondering if minerva can be
> patched up to support my scenario as well.
I think Minerva should be able to handle this, although I'm not convinced
that Tyrex is doing the right thing.
If you want to patch JBossPool to work with this then go ahead :-)
> > > Also, as a side issue, the jta spec says that the XAResources should
> > > support sharing (3.4.6) which seems to be lacking from the minerva (JBoss
> > > pool) implementation? Am I making a mistake here?
> >
> > You are correct, it's not supported. It's a wraper for JDBC connections,
> > don't forget, not an actual XAResource implementation.
>
> I can't forget something I did not really know :)
> Again, I am quite new to this stuff.
As am I. Have you contacted the Tyrex people about this?
Toby.
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development