ORA-00955 error while implementing Hangfire.FluentNHibernateStorage

0

Hi my oracle version is:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

I am using Hangfire.FluentNHibernateStorage v1.2.1020 version.

In owin startup here what I am doing in Configuration method:

    var options = new FluentNHibernateStorageOptions
        {
            TransactionIsolationLevel = IsolationLevel.Serializable,
            QueuePollInterval = TimeSpan.FromSeconds(15),
            JobExpirationCheckInterval = TimeSpan.FromHours(1),
            CountersAggregateInterval = TimeSpan.FromMinutes(5),
            UpdateSchema = true,
            
            DashboardJobListLimit = 50000,
            InvisibilityTimeout = TimeSpan.FromMinutes(15),
            TransactionTimeout = TimeSpan.FromMinutes(3),
            DefaultSchema = "hangfire_test", 
            TablePrefix = "Hangfire_"
        };

        var conStr = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
        var storage = FluentNHibernateStorageFactory.For(ProviderTypeEnum.OracleClient10, conStr, options);

        GlobalConfiguration.Configuration.UseStorage(storage);
        app.UseHangfireDashboard();

In this line:

 var storage = FluentNHibernateStorageFactory.For(ProviderTypeEnum.OracleClient10, conStr, options);

the code throws error saying:

    [OracleException (0x80131938): ORA-00955: 
]
   System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) +337363
   System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) +1103
   System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) +547
   System.Data.OracleClient.OracleCommand.ExecuteNonQuery() +115
   NHibernate.Tool.hbm2ddl.SchemaUpdate.Execute(Action`1 scriptAction, Boolean doUpdate) +726

[SchemaException: Schema update failed with 2 exceptions.  See Exceptions property]
   Snork.FluentNHibernateTools.<>c__DisplayClass7_3.<GetSessionFactoryInfo>b__1(Configuration cfg) in C:\Users\xrjef\source\repos\Snork.FluentNHibernateTools\src\Snork.FluentNHibernateTools\SessionFactoryBuilder.cs:115
   FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in /_/src/FluentNHibernate/Cfg/FluentConfiguration.cs:257

[FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

]
   FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in /_/src/FluentNHibernate/Cfg/FluentConfiguration.cs:262
   FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in /_/src/FluentNHibernate/Cfg/FluentConfiguration.cs:230

...

c#
oracle
fluent-nhibernate
hangfire
asked on Stack Overflow Dec 15, 2020 by ilhank • edited Dec 16, 2020 by ilhank

1 Answer

0

I'm not familiar with what you are doing, but - ORA-00955 means "name is already used by an existing object".

For example: there's a table named TEST in my schema. If I try to create a procedure whose name is TEST, Oracle will complain that I can't do that because object with such a name already exists. To illustrate it:

SQL> create table test (id number);

Table created.

SQL> create or replace procedure test as
  2  begin
  3    null;
  4  end;
  5  /
create or replace procedure test as
*
ERROR at line 1:
ORA-00955: name is already used by an existing object


SQL>

So: check what you are doing and either drop object that already uses that name (if you don't need it), or rename the object you're trying to create.

answered on Stack Overflow Dec 15, 2020 by Littlefoot

User contributions licensed under CC BY-SA 3.0