Forum: JRuby doc on JNDI / Rails 2.2

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.
AD (Guest)
on 2008-12-22 22:53
(Received via mailing list)
is there a cohesive doc on using Rails 2.2 with JNDI connection pooling
and
how it is used in conjunction with the new activereord-jdbc gem ?

From the changelog it seems you can simply use jndi line in the
database.yml, set pool > JNDI pool and you should be good, but not sure
if
that is all that is needed.

Nick any advice here?  We are looking to use JNDI (since other apps will
need the connection pool that are non-rails) so we want to make sure we
set
this up correctly.

Thanks
Adam
Nick S. (Guest)
on 2008-12-22 23:32
(Received via mailing list)
On Mon, Dec 22, 2008 at 2:52 PM, AD <removed_email_address@domain.invalid> 
wrote:
> is there a cohesive doc on using Rails 2.2 with JNDI connection pooling and
> how it is used in conjunction with the new activereord-jdbc gem ?
>
> From the changelog it seems you can simply use jndi line in the
> database.yml, set pool > JNDI pool and you should be good, but not sure if
> that is all that is needed.
>
> Nick any advice here?  We are looking to use JNDI (since other apps will
> need the connection pool that are non-rails) so we want to make sure we set
> this up correctly.

That's pretty much it, set the "jndi:" setting to point to your data
source. Although currently I haven't found a good way to completely
route around Rails' connection pool, so you'll want to make sure that
the Rails connection pool ("pool:" setting in database.yml) is sized
at least as big as your JNDI pool. (I should have thought through it a
little more since I wrote it, but it needed to get out the door :). So
what's happening is there's an extra, somewhat unnecessary layer of
pooling of the Rails adapters. But activerecord-jdbc 0.9 should be set
up to properly release the JNDI connection pool when the Rails
connection adapter is checked in.

/Nick

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

    http://xircles.codehaus.org/manage_email
AD (Guest)
on 2008-12-23 00:04
(Received via mailing list)
Ok thanks, with the new Rails 2.2, this is definitely something worthy
of a
Wiki update.  i will try and work on something once I get the kinks all
worked out.

So does this mean we are connectionpooling to a rails connectionpool ?

Thx
Adam
Nick S. (Guest)
on 2008-12-23 06:59
(Received via mailing list)
On Mon, Dec 22, 2008 at 4:03 PM, AD <removed_email_address@domain.invalid> 
wrote:
> Ok thanks, with the new Rails 2.2, this is definitely something worthy of a
> Wiki update.  i will try and work on something once I get the kinks all
> worked out.
>
> So does this mean we are connectionpooling to a rails connectionpool ?

Basically, yes.

/Nick

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

    http://xircles.codehaus.org/manage_email
Stephen B. (Guest)
on 2008-12-23 07:26
(Received via mailing list)
>is there a cohesive doc on using Rails 2.2 with JNDI connection
>pooling and how it is used in conjunction with the new
>activereord-jdbc gem ?
>
>From the changelog it seems you can simply use jndi line in the
>database.yml, set pool > JNDI pool and you should be good, but not
>sure if that is all that is needed.

This article might be helpful:

http://syntatic.wordpress.com/2008/08/20/connectio...

They focus on Oracle and JBoss but claim the techniques are general.

Right now there are two jndi related pages in the jruby wiki:

   http://wiki.jruby.org/wiki/Rails_with_H2_in_JNDI_on_Jetty

And a link titled "JNDI with Rails" that points to an external url:

   http://blarg.slackworks.com/posts/jndi-with-rails

It would probably be good to have a main JNDI_with_Rails page that
references both of these resources as well as the first link I
mentioned.

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

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.