Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

synchronization question 1

Status
Not open for further replies.

tvrtko

Programmer
Nov 26, 2003
53
HR
I access DataSource object via JNDI

InitialContext ctx = new InitialContext();

DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MyDB");

and getting connection with

conn = ds.getConnection();

Is it necessery to synchronize any of these statements?

Can I put DataSource object in the context and share it among users?
Are there any synchronization issues about that?

Thanks in advance.
 
As timw said - please do not cross-post between forums here - pick one and stick with it (JSP/Servlet forum) !

You do not need to synchronize these statements - the pooling system will do this for you.

I would also advise reading and following the advice in this thread :
--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top