Hi,
What is the difference between javax.sql.DataSource and javax.sql.ConnectionPoolDataSource interfaces? In API docs it is written that connection pool implementation of the DataSource works with a middle-tier connection pooling manager. I am using mm.mysql, and I am wondering if connection pool is implemented with this MySQL driver. As far as I see from previous postings everyone seems to use a third party connection pooling manager such as tyrex, poolman, protomatter, etc. Similarly, what is the difference between a java.sql.Connection and javax.sql.PooledConnection interfaces in this context? TIA, Ozgur. > -----Original Message----- > From: Scott Jones [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 22, 2002 10:09 AM > To: Tomcat Users List > Cc: Chad Johnson > Subject: Re: DBCP Database Connection pooling in TC4 > > > 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]> > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
