Title: [739] trunk/activerecord-jdbc/lib/active_record/connection_adapters/jdbc_adapter.rb: Allow JNDI to fall back to JDBC, so that you can use
Revision
739
Author
nicksieger
Date
2007-09-11 02:08:00 -0400 (Tue, 11 Sep 2007)

Log Message

Allow JNDI to fall back to JDBC, so that you can use 
regular + jndi configuration all in one environment config

Modified Paths

Diff

Modified: trunk/activerecord-jdbc/lib/active_record/connection_adapters/jdbc_adapter.rb (738 => 739)


--- trunk/activerecord-jdbc/lib/active_record/connection_adapters/jdbc_adapter.rb	2007-09-11 06:02:59 UTC (rev 738)
+++ trunk/activerecord-jdbc/lib/active_record/connection_adapters/jdbc_adapter.rb	2007-09-11 06:08:00 UTC (rev 739)
@@ -269,7 +269,12 @@
       def initialize(config)
         @config = config.symbolize_keys!
         if @config[:jndi]
-          configure_jndi
+          begin
+            configure_jndi
+          rescue => e
+            warn "JNDI data source unavailable: #{e.message}; trying straight JDBC"
+            configure_jdbc
+          end
         else
           configure_jdbc
         end
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to