Open itemrdo opened 12 years ago
Do you run into this issue if you run 0.8.5?
Yes, 0.8.5 gave me the same exception.
I debugged the application to found out it was because I hadn't supplied the assembly name for the database type (a clearer error message would have been more convenien though): --dt=roundhouse.databases.oracle should have been: --dt="roundhouse.databases.oracle.OracleDatabase, roundhouse.databases.oracle"
..which let me continue to the next set of exceptions. I had to make a few code changes to get RoundhousE working on Oracle:
"Had an error building session factory from merged, attempting unmerged. The error: FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. ---> System.TypeLoadException: Could not load type 'roundhouse.databases.oracle.orm.VersionMapping' from assembly 'roundhouse, Version=0.0.0.0, Culture=neutral, PublicKeyToken=91b86fd44f1f23bc'."
==> I hacked my way out of this one by adding the roundhouse.databases.oracle.orm classes to the roundhouse assembly
1 parameters) at roundhouse.databases.AdoNetDatabase.run_command_with(String sql_to_run, ConnectionType connection_type, IList
1 parameters)
at roundhouse.databases.AdoNetDatabase.run_sql(String sql_to_run, ConnectionType connection_type, IList`1 parameters)
at roundhouse.databases.oracle.OracleDatabase.insert_version_and_get_version_id(String repository_path, String repository_version)
at roundhouse.migrators.DefaultDatabaseMigrator.version_the_database(String repository_path, String repository_version)
at roundhouse.runners.RoundhouseMigrationRunner.run()"==> fixed by changing roundhouse.databases.AdoNetDatabase:180 command.Parameters.Add(parameter.underlying_type); to command.Parameters.Add(((ICloneable)parameter.underlying_type).Clone());
"RoundhousE encountered an error. System.Data.OracleClient.OracleException: ORA-01008: not all variables bound
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 roundhouse.databases.AdoNetDatabase.run_command_with(String sql_to_run, ConnectionType connection_type, IList1 parameters) at roundhouse.databases.AdoNetDatabase.run_sql(String sql_to_run, ConnectionType connection_type, IList
1 parameters)
at roundhouse.databases.oracle.OracleDatabase.insert_version_and_get_version_id(String repository_path, String repository_version)
at roundhouse.migrators.DefaultDatabaseMigrator.version_the_database(String repository_path, String repository_version)
at roundhouse.runners.RoundhouseMigrationRunner.run()"
==> fixed by adding if (parameter.value == null) parameter.underlying_type.Value = DBNull.Value; above command.Parameters.Add(((ICloneable)parameter.underlying_type).Clone()); in roundhouse.databases.AdoNetDatabase
==> fixed by changing get_version_id_script() in roundhouse.databases.oracle.OracleDatabase:
public string get_version_id_script(string repositoryPath)
{
return string.Format(
@"
SELECT id
FROM (SELECT * FROM {0}_{1}
{0}
ORDER BY entry_date DESC)
WHERE ROWNUM < 2
",
roundhouse_schema_name, version_table_name, string.IsNullOrEmpty(repositoryPath) ? "" : "WHERE repository_path = :repository_path");
}
and by changing the calling code in insert_version_and_get_version_id():
var select_parameters = new List<IParameter<IDbDataParameter>>();
if (!string.IsNullOrEmpty(repository_path)) select_parameters.Add(create_parameter("repository_path", DbType.AnsiString, repository_path, 255));
return Convert.ToInt64((decimal)run_sql_scalar(get_version_id_script(repository_path), ConnectionType.Default, select_parameters));
==> I didn't look into this one, and just copied my connectionstring in --connectionstringadministration
I admit the oracle side of the house needs more love.
I'm trying to setup roundhouse for oracle:
rh.exe --connectionstring="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyOracleHost)(PORT=1521))(CONNECT_DATA=(SID=MyOracleSID)));User Id=MyUserId;Password=MyPassword;Persist Security Info=false" -vf=revision.xml -vx=//commit/@revision -env=UNITTEST -ni --runallanytimescripts --dt=roundhouse.databases.oracle
I have installed the oracle client, but I get the following exception:
StructureMap Exception Code: 207 Internal exception while creating Instance 'c9958e7c-cac9-4d25-a47d-d7eae39b882b' of PluginType roundhouse.databases.Database, rh, Version=0.7.0.281, Culture=neutral, PublicKeyToken=null. Check the inner exception for more details.
No innerexception is shown, no logfile is created and no entries are added to the windows event log.
Any ideas?