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.
James N. (Guest)
on 2008-10-23 22:27
(Received via mailing list)
I have read Arun G.'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
James N. (Guest)
on 2008-10-23 22:59
(Received via mailing list)
Dick D. (Guest)
on 2008-10-24 13: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 N. <removed_email_address@domain.invalid>
wrote:
> Found the answer here.
>
> On Thu, Oct 23, 2008 at 12:15 PM, James N. <removed_email_address@domain.invalid>
> wrote:
>>
>> I have read Arun G.'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
Albert R. (Guest)
on 2008-10-24 13: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 D. <removed_email_address@domain.invalid>
wrote:
>>> I have read Arun G.'s blog  on using jruby/rails with a glassfish
>
>

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

    http://xircles.codehaus.org/manage_email
Arun G. (Guest)
on 2008-10-25 03: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 N. 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
Nick S. (Guest)
on 2008-10-27 16: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 D. <removed_email_address@domain.invalid>
wrote:
>>> I have read Arun G.'s blog  on using jruby/rails with a glassfish
>
>

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

    http://xircles.codehaus.org/manage_email
Dick D. (Guest)
on 2008-10-27 17:12
(Received via mailing list)
On Mon, Oct 27, 2008 at 2:34 PM, Nick S. <removed_email_address@domain.invalid>
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
James N. (Guest)
on 2008-10-27 21: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.