chucknorris/roundhouse — Issue #37: (oracle) error when rh inserts a record into its own scriptsrun table
Author: wijnanjo
Created: 2011-11-30 11:51:21+00:00
State: open

We have one .sql file that rh completely executes but right after rh fails to insert that script's record in the SCRIPTSRUN table (Error is below). However, all other scripts are inserted nicely in that same table and moreover.when I split that .sql file in two, they get both inserted into the table. What is going on here?

2011-11-30 09:32:19,943 [INFO ] - Running 0005_Indexes.sql on localhost - .
2011-11-30 09:32:20,033 [ERROR] - roundhouse.databases.oracle.OracleDatabase with provider System.Data.OracleClient does not provide a facility for recording scripts run at this time.
could not insert: [roundhouse.model.ScriptsRun#5][SQL: INSERT INTO PRODATA_ScriptsRun (version_id, script_name, text_of_script, text_hash, one_time_script, entry_date, modified_date, entered_by, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
2011-11-30 09:32:20,055 [ERROR] - RoundhousE encountered an error.
NHibernate.Exceptions.GenericADOException: could not insert: [roundhouse.model.ScriptsRun#5][SQL: INSERT INTO PRODATA_ScriptsRun (version_id, script_name, text_of_script, text_hash, one_time_script, entry_date, modified_date, entered_by, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)] ---> System.Data.OracleClient.OracleException: ORA-01461: can bind a LONG value only for insert into a LONG column

at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
--- End of inner exception stack trace ---
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session)
at NHibernate.Action.EntityInsertAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at roundhouse.infrastructure.persistence.Repository.save_or_update[T](T item)
at roundhouse.databases.DefaultDatabase`1.insert_script_run(String script_name, String sql_to_run, String sql_to_run_hash, Boolean run_this_script_once, Int64 version_id)
at roundhouse.migrators.DefaultDatabaseMigrator.record_script_in_scripts_run_table(String script_name, String sql_to_run, Boolean run_this_script_once, Int64 version_id)
at roundhouse.migrators.DefaultDatabaseMigrator.run_sql(String sql_to_run, String script_name, Boolean run_this_script_once, Boolean run_this_script_every_time, Int64 version_id, Environment environment, String repository_version, String repository_path, ConnectionType connection_type)
at roundhouse.runners.RoundhouseMigrationRunner.traverse_files_and_run_sql(String directory, Int64 version_id, MigrationsFolder migration_folder, Environment migrating_environment, String repository_version, ConnectionType connection_type)
at roundhouse.runners.RoundhouseMigrationRunner.log_and_traverse(MigrationsFolder folder, Int64 version_id, String new_version, ConnectionType connection_type)
at roundhouse.runners.RoundhouseMigrationRunner.run()