Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Stateless Session Bean - Can DB connection be created on ejbCreate

843829Jun 17 2001 — edited Jul 5 2001
I have a stateless session bean, I need to make
a Database connection and perform some DB operations in the methods.
So instead of creating a DB connection in each and every method, I want to create the connection in ejbCreate and then assign it to a member cvariable say m_MyConnection.
I want all the methods to use m_MyConnection that was made in ejbCreate. Will the m_MyConnection exist across multiple calls of the stateless session bean ?

Is this the recommeded way of doing things or should you create and release the connection inside each method ?

Thanks,
Rahul
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2001
Added on Jun 17 2001
7 comments
277 views