Hmmm... Not what I thought.

        In the test bean org/jboss/zol/testbean/bean/EntityBMPBean in the
setEntityContext method, the bean looks up a database connection, and then
doesn't do anything with it.  It doesn't close it, and it doesn't save it,
it just lets it float merrily out of scope.  So, I think this represents a
bug in the test bean, unless we aim to be testing connection leaks!
        However, it does point the spotlight to connection management for
BMP beans, and I think the question below is still valid.  I was following
the example at the end of section 4 of the JTA spec, but I see that is
really only an example, not a spec for what order the methods may be
called in.
        Also, I think I was a little confused below, in that BMP doesn't
cause any problems, it would really be UserTransactions that cause
problems.  You have to manually manage both transactions and connections
in order to commit a connection before it is closed - but I guess ideally
this should be allowed.

Aaron

On Wed, 30 Aug 2000, Aaron Mulder wrote:
>       I notice that when I switch the test beans to use Minerva, the
> test suite fails.  It seems to barf because end(Xid, flags) was not called
> on the XAResource before prepare(Xid).  This is in the BMP section, so I
> guess the connection was not closed before it was committed?
>       So the question is, is this a valid error?  Or should you not need
> to call end on the XAResource before you call prepare/commit/rollback?
> I'm going to go surf the spec, but if anyone has the answer on the tip of
> their tongue...
> 
> Thanks,
>       Aaron
> 
> 


Reply via email to