Forum: JRuby glassfish database pool and rails persistent connections

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2008-10-23 20:27
(Received via mailing list)
I have read Arun Gupta's
blog<http://weblogs.java.net/blog/arungupta/archive/200...
on using jruby/rails with a glassfish database connection pool and I
have
been able to set this up.  I have a question regarding this though that
I'm
sure someone has encountered.  Doesn't rails use persistent connections,
which would prevent them from being returned to the pool?

I am concerned (and some simple tests seem to bear this out) that
setting up
a deployment that handles multiple simultaneous users will saturate the
connection pool and some of the threads will never get a connection.

If this is the case, can I configure rails to not use persistent
connections, or can I use an idle timeout setting on glassfish to
reclaim
idle connections?

Thanks,

James
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2008-10-23 20:59
(Received via mailing list)
A52b0e1c5d982f2512a03c5dbfd033d6?d=identicon&s=25 Dick Davies (Guest)
on 2008-10-24 11:22
(Received via mailing list)
Nice find - had seen the presentation before but didn't realise
JRuby-Rack bundled the connection pool hack; shouldn't that mean
there's no need to do anything for Rails bundled with Warbler to 'just
work'?

On Thu, Oct 23, 2008 at 7:46 PM, James Norton <jamesnorton@gmail.com>
wrote:
> Found the answer here.
>
> On Thu, Oct 23, 2008 at 12:15 PM, James Norton <jamesnorton@gmail.com>
> wrote:
>>
>> I have read Arun Gupta's blog  on using jruby/rails with a glassfish
>> database connection pool and I have been able to set this up.  I have a
>> question regarding this though that I'm sure someone has encountered.
>>  Doesn't rails use persistent connections, which would prevent them from
>> being returned to the pool?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Bc1f306c4526643e6524030285884318?d=identicon&s=25 Albert Ramstedt (Guest)
on 2008-10-24 11:34
(Received via mailing list)
I am curious - what would the benefit be using a connection pool with
rails <= 2.1 ?

On Fri, Oct 24, 2008 at 11:21 AM, Dick Davies <rasputnik@gmail.com>
wrote:
>>> I have read Arun Gupta's blog  on using jruby/rails with a glassfish
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
268f57c236bb50c0f6e12ac38adc9d81?d=identicon&s=25 Arun Gupta (arungupta)
on 2008-10-25 01:09
(Received via mailing list)
Hi James,

You can configure ActiveRecord to disconnect after every query as
described at:

http://blog.linkedin.com/blog/2008/08/jdbc-connection.html

Thanks,
-Arun

James Norton wrote:
> connection.
>
--
Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2008-10-27 15:35
(Received via mailing list)
Dick, just FYI, JRuby-Rack doesn't bundle the connection pool hack --
I thought it was a little dangerous to assume that you're always
running with a connection pool. So you'll still have to apply it
yourself.

The "hack" really needs to be applied to ActiveRecord-JDBC, but I
don't have a foolproof way of detecting that you're using a connection
pool. More likely is that I'll modify AR-JDBC to work with Rails 2.2's
connection pooling.

Cheers,
/Nick

On Fri, Oct 24, 2008 at 4:21 AM, Dick Davies <rasputnik@gmail.com>
wrote:
>>> I have read Arun Gupta's blog  on using jruby/rails with a glassfish
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
F472b397918df02e70d8d7d0cf086c00?d=identicon&s=25 Dick Davies (Guest)
on 2008-10-27 16:12
(Received via mailing list)
On Mon, Oct 27, 2008 at 2:34 PM, Nick Sieger <nicksieger@gmail.com>
wrote:
> Dick, just FYI, JRuby-Rack doesn't bundle the connection pool hack --
> I thought it was a little dangerous to assume that you're always
> running with a connection pool. So you'll still have to apply it
> yourself.

That's fine, thanks for clarifying.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2008-10-27 20:34
(Received via mailing list)
Probably.  Unfortunately, we still haven't migrated from goldspike for
our
project.
This topic is locked and can not be replied to.