Paul O'Leary wrote:
> 
> Hi Daniel,

Hi Paul, I was hoping this would draw your attention.  :)

> What do you mean by 'standalone' mode?  I assume that you have pulled the
> connection pool code out and are running it in a different application ... ?

Correct, though I'm actually just using the entire turbine-2.0.jar file
(rather than a connection pool only JAR).  I have a standalone
application--i.e. not run in concert with Turbine, or as a
servlet--which currently spawns 11 threads.  Both the main app class and
it's worker threads each pull a single connection from pool, which they
retain for their entire life span.

> Let me make this point related to the wait() in getPooledConnection: this
> wait relies on a connection being released in order to wake up.  That is,
> the notify() that will wake up threads from this wait() is in
> releaseConnection.  Now here's the important question about 'standalone'
> mode: how many threads are there?  If you're using the connection pool in an
> application that only has one thread (i.e. a regular old app) you are SOL
> when you hit that wait() because there are no other threads in the app that
> can come wake up the main thread.

So, I'm running multi-threaded here (as mentioned above), but I have
more threads requesting connections--in their constructors, all created
at once--than I have max number of connections in my pool.  I'd rather
not have to increase the maxium number of connections every time I need
more threads (I assume that this would fix the problem).

Do you have any ideas on how to address this situation?  Is there a way
to get rid of the wait() somehow?  I've been working on this since
yesterday.  :(

> This is why I need to understand what you mean by 'standalone'.  Hope I'm
> making sense.

Definitely, you saw the problem like you're standing above it and
examining it with a magnifying glass.

As an aside, what do you think about Leon's patch?  It didn't address
this particular problem (at least, in my situation), but may be a
reasonable addition anyways.
-- 

Daniel Rall <[EMAIL PROTECTED]>
http://collab.net/ | open source | do the right thing


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to