Assuming that you get the dB connection from a datasource obtained using JNDI, then 
everything will be kosher.  Get the connection in the entity bean then pass it to the 
helper class.  Make sure the helper doesn't do nasty things like commit or rollback; 
it will need to notify the entity of the appropriate result
and then the entity bean can call setRollbackOnly() if appropriate.  Closing the 
connection is OK since this should be implemented as returning the connection to the 
pool after the container commits the transaction.

Phil Lewis wrote:

> If you are using bean managed persistence, then all of the database access
> code is normal jdbc stuff.
>
> We need our system to run on EJB and non-EJB platforms, so I am wondering
> whether I can put all of the database access coed into a seperate class, and
> delegate to this class from my entity beans.
>
> I know this will compile, deploy and run, but what afect, if any, does it
> have on container managed transactions?
>
> TIA
>
> Phil Lewis
> Chief Designer
> Knowledge Management Software plc
>
> Any opinions expressed in this email are those of the individual and not necessarily 
>Knowledge Management Software plc.  This email and any files transmitted with it are 
>confidential and solely for the use of the intended recipient.
> If you are not the intended recipient or the person responsible for delivering to 
>the intended recipient, be advised that you have received this email in error and 
>that any use is strictly prohibited.  If you have received this email in error please 
>notify the Systems Manager by telephone on 44 (0) 161 227 9009
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
begin:vcard
n:Wilson;Chip
tel;work:214-642-4559
x-mozilla-html:TRUE
org:Axys Solutions
adr:;;14001 North Dallas Pkwy;Dallas;TX;75240;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Director, Enterprise Java Practice
fn:Chip Wilson
end:vcard

Reply via email to