Stateless Session Bean - Can DB connection be created on ejbCreate
843829Jun 17 2001 — edited Jul 5 2001I 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