When a database connection pool is created using the usual lookup code
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
ds = (DataSource)envContext.lookup("jdbc/SID");
Where should this be executed?
Should it only be called once per webapp to obtain a pool of connections?
If it is called repeatedly does tomcat simply return the same connection
pool instance?
Are the calls to getConnection() thread safe?
You can see my lack of understanding is coming from the fact that I want to
share the connection pool across multiple servlets. I also need to know if I
have to wrap the getConnection() call in a synchronized bloke to avoid
multiple threading issues.
If you can provide some insight that would be much appreciated
Paul