Setting up JNDI with activerecord-jdbc-adapter

I’m not sure if there is an active activerecord-jdbc mailing list, let
me know if there is and I’ll kill the noise here.

I’m working on deploying with OAS and trying to setup a JNDI connection.
I’ve setup and tested my JDBC resources and have ensured that they
work. When deploying my app as a warbler war, no connection is found
when I don’t include a username/password in my database.yml
When I do include username/password, my Rails app fails with an
ActiveRecord error that one of my tables does not exist (they all do).

Sample of my yaml:

production:
adapter: jdbc
jndi: jdbc/myapp
driver: oracle.jdbc.driver.OracleDriver
username: user
password: pass

Am I misunderstanding something about the required setup?


Jim G.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

its important to note that the JNDI pool is really a pool to the Rails
pool, not directly to the database. So your database.yml settings
need to be correct and properly connect to the DB as that is what is
actually connecting.

Out of curiousity what happens if you dont use jndi and just run
script/server, does it work ?

On Tue, Sep 29, 2009 at 4:53 PM, Jim G. [email protected] wrote:

Sample of my yaml:

Jim G.
http://www.saturnflyer.com


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

We are using jndi in our apps.

For us the setup depends on the app server you are using.

here is an excerpt from our database.yml
production:
adapter: jdbc
jndi: java:comp/env/jdbc/jndi_rails
driver: com.mysql.jdbc.Driver

This particular jndi setup is working with Tomcat

Not sure if this helps

On Tue, Sep 29, 2009 at 6:35 PM, [email protected]
[email protected] wrote:

me know if there is and I’ll kill the noise here.
production:
http://www.saturnflyer.com
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Here is how to setup JNDI connection with GlassFish and MySQL:

http://blog.arungupta.me/2008/09/totd-44-jdbc-connection-pooling-for-rails-on-glassfish-v3/

Thanks,
-Arun

Jim G. wrote:

Sample of my yaml:

production:
adapter: jdbc
jndi: jdbc/myapp
driver: oracle.jdbc.driver.OracleDriver
username: user
password: pass

Am I misunderstanding something about the required setup?


Need Application Server ? Download from http://glassfish.org
Blog: http://blog.arungupta.me


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I also think there is a rule about having the “pool” size in
database.yml >= the pool size in JNDI

Adam

On Tue, Sep 29, 2009 at 8:10 PM, Jay McGaffigan [email protected]
wrote:

actually connecting.

work. When deploying my app as a warbler war, no connection is found
username: user


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email