Hi, > -----Original Message----- > From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 25, 2002 10:58 PM > To: Tomcat Users List; [EMAIL PROTECTED] > Subject: Re: Pooling database connections: best practices? > > > Is anyone here using it via a Singleton pattern? I'm trying to figure out > the best way to use this... > > Currently, we have an object that gets a database connection (with no > pooling), and I'm trying to snap DbConnectionPool in with it. I have two > static variables > within the object now, one for db connection pool reference (that > only gets > initialized once) and a variable for a connection (public). In the > constructor of this object, I check to see if connection is null > or closed. > If it is, I get another connection from dbpool. > > When I do stress testing with Apache JMeter, I'm getting lots of > errors like > this: > > java.sql.SQLException: [Microsoft][ODBC SQL Server > Driver]Connection is busy > with results for another hstmt >
It's not quite clear to me, what will your app do if it gets another request before it has finnished with the first one? I mean will it try to use the same connection, since its not null and not closed. If it is the case so connection is really busy. > > Can you see holes in my logic? Should I just create a method that > doles out > a connection, and another that calls freeConnection after I'm > done with it? > The only reason I don't do this now is because all the changes > I'll have to > make to accomodate this. > > > TIA, > Anton. -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
