lib/og/adapters/oracle.rb in og-0.13.0 vs lib/og/adapters/oracle.rb in og-0.14.0

- old
+ new

@@ -1,11 +1,16 @@ # * Matt Bowen <matt.bowen@farweststeel.com> # * George Moschovitis <gm@navel.gr> # (c) 2004-2005 Navel, all rights reserved. -# $Id: oracle.rb 281 2005-03-10 12:24:14Z gmosx $ +# $Id: oracle.rb 326 2005-03-28 11:07:17Z gmosx $ -require 'oracle' +begin + require 'oracle' +rescue + Logger.error 'Ruby-Oracle bindings are not installed!' + Logger.error ex +end require 'og/adapter' require 'og/connection' require 'glue/attribute' @@ -297,25 +302,20 @@ def query(sql) Logger.debug sql if $DBG begin return @store.exec(sql) rescue Exception => ex - Logger.error "DB error #{ex}, [#{sql}]" - Logger.error ex.backtrace.join("\n") - raise -# return nil + handle_db_exception(ex, sql) end end def exec(sql) Logger.debug sql if $DBG begin @store.exec(sql) rescue Exception => ex - Logger.error "DB error #{ex}, [#{sql}]" - Logger.error ex.backtrace.join("\n") - raise + handle_db_exception(ex, sql) end end def start @store.autocommit = false @@ -368,8 +368,11 @@ val = res.fetch[idx].to_i res.close return val end + def get_row(res) + res.fetch + end end end