From: Jiri C. <di...@ci...> - 2010-03-19 22:23:00
|
On Fri, Mar 19, 2010 at 21:39, Bruce Tiffany <BTi...@pb...> wrote: > Yes, we can simulate it consistently by using multithreading to simulate simultaneous users in a web environment. It bombs every time. Are you using one connection on more threads (simultaneously)? > The deal was we were having lingering connections. Even if you disconnected, the system maintained a sort of "open connection" in the pool which could be reused for the next connection request, thus saving a small amount of overhead. It was suggested that we "clear all pools" when disconnecting. It depends. If you know you're not going to do work with database, then clearing pool doesn't hurt. > The trouble we eventually ran into was that when we cleared all pools, anyone else who was connected would lose his connection. Not nice. In order to reproduce this in testing, I had to spawn off a bunch of threads to connect, do some work and disconnect, each thread clearing all pools. If I just tested with one connection, I never could get an error, for obvious reasons. Well, it didn't take long at all to run into chaos. The first guy out would clear the pool(s), and then everybody else blew up. Can you provide a test case? And put it into tracker. > Apparently the connections of different simultaneous users using a web app is quite similar to multithreading. Kind of. But the pooling is thread safe, only the connection etc. itself isn't. -- Jiri {x2} Cincura (CTO x2develop.com) http://blog.cincura.net/ | http://www.ID3renamer.com |