From: Sean C. <se...@ch...> - 2002-02-16 14:35:02
|
Using the following query, anyone have any idea as to why I'd get the following error from below? I'm not sure why I'm getting this error, but here's the kicker: if I push refresh on the page, it works. I'm running about 5-10% failure for the following query and it's a tad scary that it's so inconsistent. Anyone have any ideas? The query doesn't even generate any dates: sql = 'SELECT [VARCHAR(20)], ([INT4] / 1024.0 / 1024.0) FROM....' dbh.select_all(sql, username) do |row| # This is line 75 in index.rhtml /usr/local/lib/ruby/site_ruby/1.6/dbi/utils.rb:12:in `conv_param': uninitialized constant Object::Date (NameError) from /usr/local/lib/ruby/site_ruby/1.6/dbi/utils.rb:10:in `collect' from /usr/local/lib/ruby/site_ruby/1.6/dbi/utils.rb:10:in `conv_param' from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:554:in `execute' from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:585:in `select_all' from /tmp/index.rhtml.97187.0:75 from /usr/local/lib/ruby/site_ruby/1.6/apache/eruby-run.rb:104:in `load' from /usr/local/lib/ruby/site_ruby/1.6/apache/eruby-run.rb:104:in `run' from /usr/local/lib/ruby/site_ruby/1.6/apache/eruby-run.rb:72:in `handler' from ruby:0 Anyone have any thoughts? -sc -- Sean Chittenden |
From: <520...@t-...> - 2002-02-16 17:35:20
|
Sean Chittenden wrote: > Using the following query, anyone have any idea as to why I'd get the > following error from below? I'm not sure why I'm getting this error, > but here's the kicker: if I push refresh on the page, it works. I'm > running about 5-10% failure for the following query and it's a tad > scary that it's so inconsistent. Anyone have any ideas? The query > doesn't even generate any dates: Method conv_params has a "case" statement that checks whether the passed parameter is a Date, Time or other object, and converts Date and Time objects to DBI::Date and DBI::Timestamp objects. > sql = 'SELECT [VARCHAR(20)], ([INT4] / 1024.0 / 1024.0) FROM....' > > dbh.select_all(sql, username) do |row| # This is line 75 in index.rhtml > > /usr/local/lib/ruby/site_ruby/1.6/dbi/utils.rb:12:in `conv_param': uninitialized constant Object::Date (NameError) > from /usr/local/lib/ruby/site_ruby/1.6/dbi/utils.rb:10:in `collect' This error occures if there is no "Date" object. I'm sure it is a problem related to mod_ruby. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de |
From: Sean C. <se...@ch...> - 2002-02-16 17:25:28
|
> > Using the following query, anyone have any idea as to why I'd get > > the following error from below? I'm not sure why I'm getting this > > error, but here's the kicker: if I push refresh on the page, it > > works. I'm running about 5-10% failure for the following query > > and it's a tad scary that it's so inconsistent. Anyone have any > > ideas? The query doesn't even generate any dates: > > Method conv_params has a "case" statement that checks whether the > passed parameter is a Date, Time or other object, and converts Date > and Time objects to DBI::Date and DBI::Timestamp objects. ::Date is he same as Object::Date ? > This error occures if there is no "Date" object. I'm sure it is a > problem related to mod_ruby. <:~) Okey dokey. I haven't been able to reproduce it in any other venue so I wasn't sure. I'll see if I can dig up the right finalizer again... Thanks. -sc -- Sean Chittenden |
From: <520...@t-...> - 2002-02-17 12:20:02
|
Sean Chittenden wrote: > > > Using the following query, anyone have any idea as to why I'd get > > > the following error from below? I'm not sure why I'm getting this > > > error, but here's the kicker: if I push refresh on the page, it > > > works. I'm running about 5-10% failure for the following query > > > and it's a tad scary that it's so inconsistent. Anyone have any > > > ideas? The query doesn't even generate any dates: > > > > Method conv_params has a "case" statement that checks whether the > > passed parameter is a Date, Time or other object, and converts Date > > and Time objects to DBI::Date and DBI::Timestamp objects. > > ::Date is he same as Object::Date ? Yes, it's the same. In this case, :: could be ommitted, as there is no DBI::Date class. > > This error occures if there is no "Date" object. I'm sure it is a > > problem related to mod_ruby. > > <:~) Okey dokey. I haven't been able to reproduce it in any other > venue so I wasn't sure. I'll see if I can dig up the right finalizer > again... Thanks. -sc Ok. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de |
From: Sean C. <se...@ch...> - 2002-02-19 00:39:07
|
> > > Method conv_params has a "case" statement that checks whether > > > the passed parameter is a Date, Time or other object, and > > > converts Date and Time objects to DBI::Date and DBI::Timestamp > > > objects. > > > > ::Date is he same as Object::Date ? > > Yes, it's the same. In this case, :: could be ommitted, as there is > no DBI::Date class. Hmm... this is most odd. Ah ha! Looks like a combination of a few things were getting in the way and causing this problem. 1) Object::Date is set someplace inside of dbi 2) auto-reload was being used 3) auto-reload performs a basic mapping between the class name and the file system which was causing problems between /usr/local/lib/ruby/1.6/date.rb and dbi's definition of date. > > > This error occures if there is no "Date" object. I'm sure it is > > > a problem related to mod_ruby. Yeah, auto-reload doesn't mesh so well with DBI: auto-reload was finding the wrong date module (date.rb, not DBI's class Date). The work around is to turn off auto-reload. -sc -- Sean Chittenden |