Hi all, I must say I''m very new to Rails, as well as Ruby so excuse my ''noobie'' question. I made the ''Depot'' application from the ''Agile Web Development with Rails'' book using MySql. However, I decided to experiment a little with using Oracle instead of MySql the second time through. I installed the driver and everything works fine, except updating records which really baffles me. When I update/edit a record the edited value is passed in properly, but for some reason the value reverts back to the original value when the record is re-displayed. I have a screen shot of the development log file and code excerpts that I''m using here: http://www.iso3200.com/ror/ Do I need to perform some type of commit or save action when updating so the value doesn''t revert back to it''s original state when using Oracle? Thank you! Dave _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 11/2/05, Dave Hoefler <dhoefler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > When I update/edit a record the edited value is passed in properly, but > for some reason the value reverts back to the original value when the record > is re-displayed. I have a screen shot of the development log file and code > excerpts that I''m using here: http://www.iso3200.com/ror/ > > Do I need to perform some type of commit or save action when updating so > the value doesn''t revert back to it''s original state when using Oracle?You need to commit or set autocommit to make your changes stick. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
> Do I need to perform some type of commit or save action when > updating so the value doesn''t revert back to it''s original state > when using Oracle? > > > You need to commit or set autocommit to make your changes stick.Autocommit is turned on in the oci adapter. From the log output, this issue isn''t Oracle "remembering" the change -- it''s that the update is incorrect. I don''t immediately see the issue though.
I had a feeling autocommit was automatically turned on. The funny thing is, everything works fine with mysql... but not Oracle. Hmm.... On 11/2/05, Michael Schoen <schoenm-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org> wrote:> > > Do I need to perform some type of commit or save action when > > updating so the value doesn''t revert back to it''s original state > > when using Oracle? > > > > > > You need to commit or set autocommit to make your changes stick. > > Autocommit is turned on in the oci adapter. > > From the log output, this issue isn''t Oracle "remembering" the change > -- it''s that the update is incorrect. I don''t immediately see the issue > though. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Dave Hoefler wrote:> I had a feeling autocommit was automatically turned on. The funny thing > is, everything works fine with mysql... but not Oracle. Hmm....Seemingly no UPDATE statement is being issued... You might want to sprinkle breakpoint statements about the place to find out why this isn''t happening. By the way it helps if you say what versions of rails, whether you are using webrick etc. Oh and what happens if you stick logger.debug("update failed") in the else part of the update function?