|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
question about H2, Tomcat, JNDI and JRubyHi Frank,
At 9:25 AM -0700 3/12/08, Frank LeHouillier wrote: >Using a JNDI DataSource works great, thanks. I will >try to add what I've learned to the wiki soon. I have exactly this problem -- multiple instances of my RoR webapp need access to the H2 database. Did you add any documentation to the wiki. If you don't have time can you send me any info about how you did it and I'll add to the wiki after I get it working. I discovered a problem that might only occur using JRuby-Rack -- I had to specify the full path to the database like this in config/database.yml: production: adapter: jdbch2 database: <%= RAILS_ROOT %>/db/sds_h2_database see: http://www.nabble.com/problem-accessing-H2-db-in-tomcat%2C-w-warble-war-and-jruby-rack-td16136614.html#a16136614 for more details. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: question about H2, Tomcat, JNDI and JRubyJust a quick bump on this topic since I think I am having the same problem but with Embedded derby. Can you please post your tomcat JNDI settings? I didn't see anything on the Wiki yet.
Thanks! Chris
|
|
|
Re: question about H2, Tomcat, JNDI and JRuby (example given)I was able to get my JRuby on Rails application working with H2 using a JNDI database pool. I am using JRuby 1.1RC3 with warbler 0.9.4 with the 1.1RC3 complete and goldspike 1.6 jars with tomcat 5.5.26. The primary reason I had to do this was because tomcat on windows was giving me errors saying multiple processes were trying to access the database. On UNIX (Linux and Solaris), this didn't happen.
The following is what I added to the conf/context.xml in my tomcat install. <Resource name="h2/maadn_production" type="javax.sql.DataSource" url="jdbc:h2:/home/Chris/projects/h2_databases/maadn_production" driverClassName="org.h2.Driver" username="" password="" maxActive="100" maxIdle="20"/> I also had to add the h2 jar to the common/lib. Here is what my database.yml looked like production: adapter: jdbch2 jndi: java:h2/maadn_production Thanks Chris
|
|
|
Re: question about H2, Tomcat, JNDI and JRubyCan you please send instructions how to configure jndi on tomcat/jboss and on jruby?
Regards, Marcelo Murad
|
|
|
Re: question about H2, Tomcat, JNDI and JRubyHere is a blog entry that shows the steps for GlassFish:
http://blogs.sun.com/arungupta/entry/totd_9_using_jdbc_connection I'd imagine similar steps for Tomcat/JBoss as well. -Arun Murad wrote: > Can you please send instructions how to configure jndi on tomcat/jboss and on > jruby? > > Regards, > Marcelo Murad > > > > Stephen Bannasch-3 wrote: >> Hi Frank, >> >> At 9:25 AM -0700 3/12/08, Frank LeHouillier wrote: >>> Using a JNDI DataSource works great, thanks. I will >>> try to add what I've learned to the wiki soon. >> I have exactly this problem -- multiple instances of my RoR webapp need >> access to the H2 database. >> >> Did you add any documentation to the wiki. If you don't have time can you >> send me any info about how you did it and I'll add to the wiki after I get >> it working. >> >> I discovered a problem that might only occur using JRuby-Rack -- I had to >> specify the full path to the database like this in config/database.yml: >> >> production: >> adapter: jdbch2 >> database: <%= RAILS_ROOT %>/db/sds_h2_database >> >> see: >> >> http://www.nabble.com/problem-accessing-H2-db-in-tomcat%2C-w-warble-war-and-jruby-rack-td16136614.html#a16136614 >> >> for more details. >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> >> > -- Application Platform, Sun Microsystems, Inc. Blog: http://blogs.sun.com/arungupta --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: question about H2, Tomcat, JNDI and JRubyI finally got it to work jndi with jboos. Bellow is an example of files configuration.
=====oracle-ds.xml===== <?xml version="1.0" encoding="ISO-8859-1"?> <datasources> <!-- InĂcio: Datasource Technip --> <local-tx-datasource> <jndi-name>simu3</jndi-name> <connection-url>jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:simu3</connection-url> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> <user-name>login</user-name> <password>password</password> <attribute name="MinSize">5</attribute> <attribute name="MaxSize">20</attribute> <attribute name="BlockingTimeoutMillis">5000</attribute> <attribute name="IdleTimeoutMinutes">15</attribute> <idle-timeout-minutes>5</idle-timeout-minutes> </local-tx-datasource> </datasources> =====warble.rb===== have to enable the line in warble.rb like this: # Additional files/directories to include, above those in config.dirs config.includes = FileList["jboss-web.xml"] # JNDI data source name config.webxml.jndi = "jdbc/simu3" =====database.yml===== production: adapter: jdbc jndi: "java:/simu3" driver: oracle.jdbc.driver.OracleDriver =====jboss-web.xml===== <?xml version="1.0" encoding="UTF-8"?> <jboss-web> <resource-ref> <res-ref-name>jdbc/simu3</res-ref-name> <jndi-name>java:/simu3</jndi-name> </resource-ref> </jboss-web> The most important thing was the creation of jboss-web.xml Regards, Marcelo Murad
|
| Free Forum Powered by Nabble | Forum Help |