Hello,
Running Ruby 1.8.6 and Rails 2.2.2 against an Oracle XE database
(sigh).
I just upgraded Rails from 1.2.3 to 2.2.2, which made my cookie based
system for storing session information to error out due to the 4Kb
limit. So, I tried to turn on the active_record_store system by un-
commenting out the “config.action_controller.session_store
= :active_record_store” line in environment.rb and then create a db
session (db:sessions:create) and run a rake migration (rake
db:migrate).
Got all that done, which created a table named SESSIONS in the DB.
However I had to tweak the migration code because the table name
generated was singular (SESSION) and Oracle didn’t like that name. I
searched the internet and found a sample where the table name was
plural (SESSIONS), so I made the change hoping for the best. Here is
the SQL generated:
CREATE TABLE “SESSIONS”
( “ID” NUMBER(38,0) NOT NULL ENABLE,
“SESSION_ID” VARCHAR2(255) NOT NULL ENABLE,
“DATA” CLOB,
“CREATED_AT” DATE,
“UPDATED_AT” DATE,
PRIMARY KEY (“ID”) ENABLE
)
/
CREATE INDEX “INDEX_SESSIONS_ON_SESSION_ID” ON
“SESSIONS” (“SESSION_ID”)
/
CREATE INDEX “INDEX_SESSIONS_ON_UPDATED_AT” ON
“SESSIONS” (“UPDATED_AT”)
/
But now, when I try to start my application, I get an error I’ve been
unable to solve. This is the error:
/!\ FAILSAFE /!\ Wed Dec 24 22:36:41 -0500 2008
Status: 500 Internal Server Error
“DESC session” failed; does it exist?
(eval):3:in ‘describe’
c:/ruby/lib/ruby/gems/1.8./gems/activerecord-oracle-adapter01.0.0.9250/
lib/active_record/connection_adapters/oracle_adapter.rb:334: in
‘columns’
And here are the first 2 lines of the method:
def columns(table_name, name = nil) #:nodoc:
(owner, table_name) = @connection.describe(table_name)
I believe the problem is in the table name change I made (from
singular to plural). I have looked to see if there was a way in Rails
to override the name of the table that stores session information but
couldn’t find any.
I really would appreciate some help on this.
Thanks in advance.
Pepe