The logic for when to return the Connections back to the pool (if say the
close() methods where not called) would be tricky since they aren't always
attached to a transaction.

Jonathan
-----Original Message-----
From: Toby Allsopp [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 23 May 2001 9:19 a.m.
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Re: Multiple Remote EJB Requests Bombs JBoss


On Wed, May 23, 2001 at 08:18:20AM +1200, Jonathan Ackerman wrote:
> 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 :(

I still don't see the problem.  If the resource you're using supports
non-transactional access then you'll just use it outside a transaction,
otherwise you'll get some kind of exception or something.

What problems do you see with this?

Toby.

> Jonathan
> 
> -----Original Message-----
> From: Toby Allsopp [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 22 May 2001 6:57 p.m.
> 
> 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