I think that BMT complicates this quite a bit.

Check out section 11.3.3 of the EJB 1.1 spec. The example code gets the
Connections before the transaction is created and only closes them after the
transaction is committed.

This leaves two points (before and after the transaction) during which the
Connections could be used outside of an transaction :(

Jonathan

-----Original Message-----
From: Toby Allsopp [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 22 May 2001 6:57 p.m.
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Re: Multiple Remote EJB Requests Bombs JBoss


Guy Rouillier wrote:

> Hmm, I see a potential problem with this.  What if I have logic like this:
> 
> Get a whole bunch of data from somewhere.
> Get a database connection.
> For each record
>       Do a whole bunch of database work
>       Commit
>        If database work failed
>             Log an error
>        Continue
> 
> This is a pretty common scenario.  If you return the connection to the
pool
> once the transaction is finished, this code won't work.


Ah, but when you start the new transaction, the container will know that 
you still have a connection handle, so it will associate that handle 
with a connection participating in the new transaction.

I hadn't thought about BMT before, but I can't see why it wouldn't work.

Toby.



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to