Maybe this has been discussed before, I did some searching thru the list archives and couldn't find anything...
I wrote a multithreaded unit test to test out my persistence layer. I kick off threads and they each do the same query. When I make the number of threads greater than the number of pb instances in the pool, I get a NoSuchElementException thrown. This may all be painfully obvious behavior but I guess I'm wondering a few things: 1) Is this in fact supposed to happen? i.e. does this mean i'm doing something wrong or have something configured wrong? 2) should I be the one catching the NoSuchElementException and manually creating a new broker instance? 3) should I just not worry about this, because a situation like this is so unlikely in the real world (20+ simultaneous requests for a pb)? 4) is the normal solution to this problem just to jack up the number of pb instances in the pool to some number via the props file, and just hope your app doesn't need more than that number of connections at the same time? 5) from a best practices perspective, is this the behavior you'd want to happen? I was thinking maybe you'd have something that sensed when the pb pool was low/empty and instanciated new instances on the fly. Maybe that has negative ramifications. This is an honest question asked out of ignorance: I'm not at all implying that something different should be done. Regards, Steve -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
