Hi Chad,
Didn't get your emails until this morning -- are you experiencing the
same problems that I was talking about? Basically, it seems like a new
connection pool is getting set up after every JNDI lookup (which I'd
basically like to do every time I run a query). If I hold on to the
same datasource, I can see that it's obvious that connection pooling is
working...
I've just been doing something like the following the code below to test
it out. However, the thing that I notice is that rerunning this code
doesn't hold on to the original pool -- in the following code segment
the first and second connections are always > 50ms to get and the last
one (which comes from the pool) is always around 0-1ms. It seems to me
that the DataSource should get "cached" or held on to in some way --
Otherwise, it seems like it's defeating the purpose of connection
pooling!!!
How are things working for you?
Thanks.
-Scott
DataSource ds = (DataSource) envCtx.lookup("jdbc/maindb");
if (ds != null) {
System.out.println("Found the datasource!!!");
long startTime = System.currentTimeMillis();
conn = ds.getConnection();
System.out.println("opened in " + (System.currentTimeMillis() - startTime) + "
ms");
startTime = System.currentTimeMillis();
conn2 = ds.getConnection();
System.out.println("opened in " + (System.currentTimeMillis() - startTime) + "
ms");
conn.close();
startTime = System.currentTimeMillis();
// get another connection, should be faster now...
Connection conn3 = ds.getConnection();
System.out.println("opened in " + (System.currentTimeMillis() - startTime) + "
ms");
conn3.close();
conn2.close();
} else {
System.out.println("Didn't find it...");
}
On Sat, 2002-04-20 at 08:46, Chad Johnson wrote:
> Hey,
> Well I was able to get this setup rolling this morning. Thanks in advance > for
>anywork you might have put into my question.
>
> -Chad Johnson
--
Scott Jones
On-Site Manager, Inc.
[EMAIL PROTECTED]
8-ONSITEMGR (866-748-3647)
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>