Hi Everybody ,
I my project I have written a BMP which deals with two tables in Oracle.
I am opening the connection to the database in the setEntityContext() method using it in all the database routines and then closing it in the unSetEntityContext() method.Its working fine.
But my PM says that its not effiecint to open the connection in setEntityContext() method, keeping it live and then closing it at the end in unSetEntityContext()
I have got large no. of database routine methods, will it affect performance or working of my BMP if I open & close the conn in every method .........How is it done normally .....what is the convention
what the EJB specs says about this
If anybody has an idea please let me know
Thanks in Advance
hi rupesh ,
well c rupesh , every time opening/closing the db
if it is across the network , then obvious there will be overheads which will be affecting the EJB performance but the thing is as EJB container uses connection pool
so every time , container gives u the connection from the connection pool.
so over all the point is open connection where u want & close it (remember)
hope u find this information useful
well rupesh i want to know one thing
i am using j2sdkee1.3 as my ejb container
the problem i am facing the i am unable to get connected to
my DataBase (Oracle 8i)
could u list the sol/steps to help me out
for further information on this pls look to the
"SqlException Not a suitable Driver" message
Message in Discussion / EJB Programming
"I have got large no. of database routine methods, will it affect performance or working of my BMP if I open & close the conn in every method .........How is it done normally .....what is the convention "
Of course it won't, you're not opening connections, you'r returning one from a pool.
As u said that u use BMP in ur project, why don't u try using our product "FrontierSuite" a complete suite with which u can model, build and deploy Java applications in both managed and non-managed environments. To put it simple, we provide persistent framework for Java objects in both managed(EJB) & non-managed(Standalone) environments. With our persistent framework, u don't have to worry about connections or anything. To know more about us and our products, do logon to our website www.objectfrontier.com. Also Evaluation softwares are available for FREE downloads, check it out.