Ruby Forum Rails-core (closed, excessive spam) > Oracle/AR test harness temporarily disabled

Posted by Michael A. Schoen (Guest)
on 08.10.2007 00:49
(Received via mailing list)
I've temporarily turned off the automatic testing of the Oracle adapter,
while I get the new adapter gems stuff all working properly.

Given that the adapter is now removed from core, I'm open to suggestions
on whether it's still appropriate to have test failures emailed to this
list.

On the one hand, it's no longer core's responsibility to apply Oracle
fixes; on the other hand, it may still be helpful for core to be aware
of breakages.

Feedback?
Posted by Michael Koziarski (Guest)
on 08.10.2007 03:34
(Received via mailing list)
> On the one hand, it's no longer core's responsibility to apply Oracle
> fixes; on the other hand, it may still be helpful for core to be aware
> of breakages.
>
> Feedback?

There are still a lot of potential issues that we could cause in the
adapters.  I think for a while it's ok to have the reports coming
here, assuming that you can fix the outstanding issues ;).



--
Cheers

Koz
Posted by Jeremy Kemper (Guest)
on 08.10.2007 06:29
(Received via mailing list)
On 10/7/07, Michael A. Schoen <schoenm@earthlink.net> wrote:
> On the one hand, it's no longer core's responsibility to apply Oracle
> fixes; on the other hand, it may still be helpful for core to be aware
> of breakages.

The adapters are still a vital part of Active Record, regardless of
svn location.

Plus, I really like the instant feedback.

Please keep it up!

Best,
jeremy
Posted by SP (Guest)
on 25.11.2007 17:37
(Received via mailing list)
Can someone tell me where the new Rails 2.0/edge Oracle adapter code
now resides?  I have a few things I would like to add.

I am running into problems with activerecord-oracle-adapter v1.0.0
installed.  The biggest one is that select_rows is abstract on
OracleAdapter class.

I fixed this by putting the following in my Rails 2.0 application's
lib/oracle_patch.rb and including it in my config/environment.rb:
----
require 'active_record/connection_adapters/oracle_adapter'
module ActiveRecord
  module ConnectionAdapters
    class OracleAdapter
      def select_rows(sql, name = nil)
        @connection.query_with_result = true
        result = execute(sql, name)
        rows = []
        result.each { |row| rows << row }
        result.free
        rows
      end
    end
  end
end
----

If someone let's me know where the new source is (it doesn't appear to
be in the activerecord SVN tree as of r8200) and what the patch
process is for that, I will happily apply this and other Oracle
patches I have.

Thanks,
SP
Posted by Michael Koziarski (Guest)
on 25.11.2007 21:29
(Received via mailing list)
On Nov 26, 2007 5:37 AM, SP <mbbx6spp@gmail.com> wrote:
> ----
>         rows
>       end
>     end
>   end
> end
> ----
>
> If someone let's me know where the new source is (it doesn't appear to
> be in the activerecord SVN tree as of r8200) and what the patch
> process is for that, I will happily apply this and other Oracle
> patches I have.

http://dev.rubyonrails.org/browser/adapters/oracle

Michael Schoen's the maintainer so talk with him about the patches you
have in mind.


--
Cheers

Koz
Posted by lianliming (Guest)
on 26.11.2007 03:01
(Received via mailing list)
Hi,

On Nov 26, 12:37 am, SP <mbbx6...@gmail.com> wrote:
> Can someone tell me where the new Rails 2.0/edge Oracle adapter code
> now resides?  I have a few things I would like to add.

http://dev.rubyonrails.org/browser/adapters/oracle
Posted by Ian Zabel (ianzabel)
on 14.12.2007 21:22
SP wrote:

> 
> I fixed this by putting the following in my Rails 2.0 application's
> lib/oracle_patch.rb and including it in my config/environment.rb:

There's a defect on this bug in Rails Trac.

Closing the loop.

http://dev.rubyonrails.org/ticket/10415
Posted by Ian Zabel (ianzabel)
on 17.12.2007 18:19
SP wrote:
> 
> I fixed this by putting the following in my Rails 2.0 application's
> lib/oracle_patch.rb and including it in my config/environment.rb:
> ----
> require 'active_record/connection_adapters/oracle_adapter'
> module ActiveRecord
>   module ConnectionAdapters
>     class OracleAdapter
>       def select_rows(sql, name = nil)
>         @connection.query_with_result = true
>         result = execute(sql, name)
>         rows = []
>         result.each { |row| rows << row }
>         result.free
>         rows
>       end
>     end
>   end
> end
> ----

I tried this with Oracle 8i, and it didn't work. This works for me:


def select_rows(sql, name = nil)
  cursor = execute(sql, name)
  rows = []
  while row = cursor.fetch
    rows << row
  end

  rows
ensure
  cursor.close if cursor
end

Can anyone verify that this works against Oracle 9/10/11?
Posted by Tim Peters (tcp)
on 12.03.2008 01:24
Ian Zabel wrote:
> I tried this with Oracle 8i, and it didn't work. This works for me:
> 
> 
> def select_rows(sql, name = nil)
>   cursor = execute(sql, name)
>   rows = []
>   while row = cursor.fetch
>     rows << row
>   end
> 
>   rows
> ensure
>   cursor.close if cursor
> end
> 
> Can anyone verify that this works against Oracle 9/10/11?

I can confirm this one works against Oracle 10g
(rails 2.0.2, activerecord-oracle-adapter 1.0.0)
Posted by Nate Wiger (Guest)
on 12.03.2008 13:56
(Received via mailing list)
I just submitted a patch that I have been using for several months
from RSI.  This is a simple patch that just addresses select_rows

        # Returns an array of arrays containing the field values.
        # Order is the same as that returned by #columns.
        def select_rows(sql, name = nil)
          result = select(sql, name)
          result.map{ |v| v.values}
        end

Can somebody from Rails core +1 this so we can get it into the Oracle
driver?  It's a bit embarrassing for us Rails promoters that this is
broken...

http://dev.rubyonrails.org/ticket/11334

Thanks,
Nate