SOLVED (see below)
When I try to create or destroy a record (running on SQLite3) in my Ruby on Rails application (or in the console), I get an SQL exception:
irb(main):014:0> ApiCache.all => [] irb(main):015:0> ApiCache.create(:hash => 'qwe', :contents => 'asd') SQLite3::SQLException: cannot rollback - no transaction is active from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite 3/database.rb:97:in `close' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite 3/database.rb:97:in `prepare' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite 3/database.rb:134:in `execute' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite 3/database.rb:517:in `rollback' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /connection_adapters/sqlite_adapter.rb:168:in `rollback_db_transaction' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /connection_adapters/abstract/database_statements.rb:176:in `transaction' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /transactions.rb:207:in `transaction' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /transactions.rb:290:in `with_transaction_returning_status' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /transactions.rb:240:in `save' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /transactions.rb:251:in `rollback_active_record_state!' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /transactions.rb:239:in `save' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activerecord-3.0.6/lib/active_record /base.rb:498:in `create' from (irb):15 from :0 irb(main):016:0> ApiCache.all => [
The record is stored in the database, but also generates such an error. I tried deleting my db and then creating and migrating it again, but it doesn't seem to be doing anything good.
I would really appreciate any ideas on how to fix this. I have never encountered such a thing before = (
DECISION
I destroyed my model and created another. There should be some conflict in the attribute names, since the new one now has fp: string contents: text and works beautifully. Maybe the hash word that destroyed SQLite =) Thanks y'all!
Fenelon
source share