On Mar 2, 7:01 am, Jason Rogers <[email protected]> wrote: > I'm banging my head trying to get a transaction to work against > Oracle, using the JDBC driver. My code is: > > DB.transaction do |db| > models.each do |model| > success &= model.save > end > end > > It seems that the "model.save" statement is not added to the > transaction. Here's the top of the stack trace. > > [INFO] 2009-03-02 09:48:20 :: BEGIN > [INFO] 2009-03-02 09:48:20 :: ROLLBACK > NativeException - java.sql.SQLException: ORA-06550: line 1, column 5: > PLS-00103: Encountered the symbol "end-of-file" when expecting one of > the following: > > begin case declare exit for goto if loop mod null pragma > raise return select update while with <an identifier> > <a double-quoted delimited-identifier> <a bind variable> << > close current delete fetch lock insert open rollback > savepoint set sql execute commit forall merge pipe > : > oracle/jdbc/driver/SQLStateMapping.java:70:in `newSQLException' > > Anybody have any clues? I know I must be doing something wrong, but > the documentation on transactions doesn't make things too clear.
Could you post a full backtrace? I don't have any real experience with oracle, but your ruby code looks ok. Note that DB.transaction yields a adapter-specific connection object, not a Database object. Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
