Hi everyone,

I followed Craig's instructions about how to setup DBCP with Tomcat 4.0
(I've got 4.0.1 right now) to do your connection pooling (as an
alternate to using the Tyrex implementation) at:
http://marc.theaimsgroup.com/?l=tomcat-user&m=101631189730747&w=2

I've got it up and running, however it doesn't seem like the connection
pooling works like I was expecting it too, so I think that I must be
making some kind of mistake.  Every time I lookup my DataSource it seems
that a new connection pool is created (maybe?)...

I look up the DataSource like this:
...
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource mainDs = (DataSource) envCtx.lookup("jdbc/maindb");
...

The first connection that I grab from the DataSource then is returned in
about 60 ms (which seems to be the time needed to really open the
connection).   If I close() that connection, and open it again using the
same DataSource object, I get the connection in 0-1 ms, which seems to
indicate that the pooling is clearly working.

However, if in another segment of code, I again look up the DataSource
through JNDI, I find that retrieving that initial connection always
takes ~60ms.  If I could "hold on" to that DataSource object, then I'd
be all set, but I thought that was the point of JNDI!  Am I missing
something?

I had things working before with the "old" method of doing things with
using the BitMechanic JDBCConnectionPool, and that worked pretty nicely
(connections that had been previously opened were always returned in 0-1
ms) -- I just want to take advantage of some of the new features that
using DataSources affords...

Thanks!

-Scott


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to