Orchard + Oracle 11g database support

Topics: Core, Customizing Orchard, General, Installing Orchard, Writing modules
Oct 31, 2012 at 3:40 PM
Edited Oct 31, 2012 at 4:04 PM

Please help me. It's a client requirement oracle 11g database and a ASP .Net MVC CMS. I only has been worked in Orchar CMS. If some one is developing oracle 11g support for orchard, please share your work, else i want to create by my self this support, can you instruct to me to do that?

Developer
Oct 31, 2012 at 10:26 PM

Hi Guillerglez88

I dont think there is any module currently out there, but I can give you places to start.

First Orchard runs off of NHibernate 3.3 So it would be worth looking up how that intereacts with Oracle.

Second take a look at the MySql implementation had been done in Orchard, Once you understand that, hooking up Oracle shouldnt be took hard.

Nick

Jan 14, 2013 at 11:49 AM
Edited Jan 14, 2013 at 11:51 AM

I'm trying to make Orchard to work with Oracle too. I've made some changes in Orchard sources:

1. ContentFieldDefinitionRecord was renamed to ContentFieldDefRecord. Reason: Oracle identifiers are restricted at 30 characters. There is ContentFieldDefinitionRecord_id identifier in Orchard which is 31 characters length.

2. All table names were replaced with short names. Reason: the same

3. OracleDatabaseProvider was created with Oracle10 dialect

4. All column names were made in uppercase. Reason: Oracle creates columns with names as defined in a query, but when executing 'select' query Oracle makes all column names in uppercase. So any standard Orchard columns can't be accessed in Oracle. This problem, I think, can be resolved in another way, but I'm not a specialist in NHibernate and Oracle.

5. NVARCHAR2 data type was replaced with VARCHAR2 in all 'create table' queries. Reason: some columns in Orchard have type NVARCHAR2(2048) and Oracle fails then trying to create table. The error (Oracle says) is that NVARCHAR2 can't be used with size more than 2000 and VARCHAR2 should be used instead of NVARCHAR2.

After all these changes I've tested Orchard with built-in SQL Server Compact and it works fine.

But with Oracle I've caught an exception (tables have been successfully created and filled):

Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.

   at Autofac.Core.Lifetime.LifetimeScope.CheckNotDisposed()   at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)   at Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.<>c__DisplayClass4.<CreateDelegate>b__3(DisplayContext context) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:line 52   at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 55   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 179   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 88   at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 71   at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 38   at Orchard.DisplayManagement.Implementation.DisplayHelperFactory.DisplayHelperBehavior.InvokeMember(Func`1 proceed, Object target, String name, INamedEnumerable`1 args) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:line 27   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass14.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13   at ClaySharp.ClayBehaviorCollection.InvokeMember(Func`1 proceed, Object self, String name, INamedEnumerable`1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)   at ASP._Page_Themes_SafeMode_Views_Layout_cshtml.Execute() in d:\Work\DDPtest\src\Orchard.Web\Themes\SafeMode\Views\Layout.cshtml:line 25   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)   at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)   at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)   at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)   at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 134   at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.<>c__DisplayClass26.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 118   at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 55   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 179   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 88   at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 71   at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 38   at Orchard.DisplayManagement.Implementation.DisplayHelperFactory.DisplayHelperBehavior.InvokeMember(Func`1 proceed, Object target, String name, INamedEnumerable`1 args) in d:\Work\DDPtest\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:line 27   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass14.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13   at ClaySharp.ClayBehaviorCollection.InvokeMember(Func`1 proceed, Object self, String name, INamedEnumerable`1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutAwareViewEngine.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in d:\Work\DDPtest\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:line 63   at Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutAwareViewEngine.LayoutView.Render(ViewContext viewContext, TextWriter writer) in d:\Work\DDPtest\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:line 90   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17()   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

I don't know what to do next to make Orchard to work with Oracle DB. Please help!

Jan 14, 2013 at 12:47 PM

Check the log (if that didn't come from the log)

Jan 14, 2013 at 1:36 PM
Edited Jan 14, 2013 at 1:37 PM

Additional info I've found just right now:
Exception described in previous post was caused by DB access failure when trying to get field with the name "Number". "Number" is a reserved word in OracleDB.
So I've changed Number to Number_. And now I have another exception:

The controller for path '/OrchardLocal/' was not found or does not implement IController.

   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)   at Orchard.Mvc.OrchardControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in d:\Work\DDPtest\src\Orchard\Mvc\OrchardControllerFactory.cs:line 76   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)   at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)   at Orchard.Mvc.Routes.ShellRoute.HttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) in d:\Work\DDPtest\src\Orchard\Mvc\Routes\ShellRoute.cs:line 155   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

 

From Orchard log:

2013-01-14 16:09:07,501 [17] Orchard.Alias.Implementation.Updater.AliasHolderUpdater - Exception during Alias refreshSystem.ArgumentNullException: Value cannot be null.Parameter name: key   at System.Collections.Concurrent.ConcurrentDictionary`2.set_Item(TKey key, TValue value)   at Orchard.Alias.Implementation.Map.AliasMap.Insert(AliasInfo info)   at Orchard.Alias.Implementation.Holder.AliasHolder.SetAliases(IEnumerable`1 aliases)   at Orchard.Alias.Implementation.Updater.AliasHolderUpdater.Refresh()

Jan 14, 2013 at 1:49 PM

Are you able to access /OrchardLocal/Admin ?

If so, then you probably don't have a content item configured as the homepage. If you are able to access the dashboard, mark one of the content items as the homepage.

Jan 14, 2013 at 2:20 PM

Yes, /OrchardLocal/Admin is accessable!
Orchard must show "Welcome to Orchard" screen after successfull setup, but with Oracle it doesn't.
Anyway it's not so important for me. The main thing that the main functionality works. I will test and investigate it deeper.

Thanks for help.

Jan 16, 2013 at 7:28 AM

Not only "Welcome to Orchard" screen doesn't work. My home page with my custom theme (url: /OrchardLocal/) doesn't work too. It throws an exception (HttpException) in 

Orchard.Mvc.Routes.ShellRoute.HttpAsyncHandler.BeginProcessRequest function:

ex.Message: The controller for path '/OrchardLocal/' was not found or does not implement IController.

log:

2013-01-16 10:20:04,410 [57] Orchard.Alias.Implementation.Updater.AliasHolderUpdater - Exception during Alias refreshSystem.ArgumentNullException: Value cannot be null.Parameter name: key   at System.Collections.Concurrent.ConcurrentDictionary`2.set_Item(TKey key, TValue value)   at Orchard.Alias.Implementation.Map.AliasMap.Insert(AliasInfo info)   at Orchard.Alias.Implementation.Holder.AliasHolder.SetAliases(IEnumerable`1 aliases)   at Orchard.Alias.Implementation.Updater.AliasHolderUpdater.Refresh()

Any idea?

Jan 16, 2013 at 9:07 AM

I've seen this happening when there's no content item set as the homepage. Did you verify that there's a content item set as the homepage?

Also make sure there's an alias for the '/' path that points to an existing content item (enable the Alias UI feature to enable the Alias menu item).

Jan 16, 2013 at 9:42 AM

It should be taken into account that all works fine with built-in SQL Server Compact. The problem appears when using OracleDB.

Jan 16, 2013 at 10:35 AM

With OracleDB there is no aliases in AliasUI.

With built-in DB there is one alias '/' with route: 'Contents/Item/Display/12'

Differences in tables that I've found:

Built-in DB:

AliasRecord table. Path = "", RouteValues = "<v Id="12" />"

ContentItemRecord table. ID=12. Data = NULL

OracleDB:

AliasRecord table. Path = NULL, RouteValues = "<v Id="12" />"

ContentItemRecord table. ID=12. Data = "<Data />"


Jan 16, 2013 at 11:02 AM

The problem is solved.

OracleDB doesn't support empty strings (empty = null). To workaround this change should be done in Orchard.Alias.Implementation.Updater.AliasHolderUpdater.Refresh function:

_aliasHolder.SetAliases(aliases.Select(alias => new AliasInfo { Path = alias.Item1 ?? string.Empty, Area = alias.Item2, RouteValues = alias.Item3 }));

Jan 16, 2013 at 6:08 PM
Edited Jan 16, 2013 at 6:45 PM

Let's summarize.

To use Oracle in Orchard the steps below should be followed:

1. Prepare database.

   Execute SQL query: create sequence hibernate_sequence

2. Restrict identifiers. Oracle identifiers (table and column names) can't be greater than 30 characters.

     a) Make sure that all field names for database records in custom modules are not greater than 30 chars.

     b) Replace (using 'Find and Replace') ContentFieldDefinitionRecord with ContentFieldDefRecord.

         Expected changes are in files:

         src\Orchard.Tests.Modules\Widgets\Services\WidgetsServiceTest.cs

         src\Orchard.Web\Core\Settings\Metadata\ContentDefinitionManager.cs

         src\Orchard.Web\Core\Settings\Metadata\Records\ContentFieldDefinitionRecord.cs

         src\Orchard.Web\Core\Settings\Metadata\Records\ContentPartFieldDefinitionRecord.cs

         src\Orchard.Web\Core\Settings\Migrations.cs

         src\Orchard.Core.Tests\Settings\Metadata\ContentDefinitionManagerTests.cs

     c) Create an utility class to make table names shorter (in my project it’s a TableAliasGenerator with Generate function which returns unique table alias)

     d) Apply TableAliasGenerator

          i. Orchard.Setup.Services.SetupService.Setup function:

var tableName = TableAliasGenerator.Generate(tablePrefix + "Settings_ShellDescriptorRecord");

          ii. (Orchard.Framework)Orchard.Data.Migration.Schema.SchemaBuilder. Aplly it in all statements like this:

CreateTableCommand(TableAliasGenerator.Generate(String.Concat(_formatPrefix(_featurePrefix), name)));

          iii. (Orchard.Framework)Orchard.Environment.ShellBuilders.CompositionStrategy.BuildRecord function:

 return new RecordBlueprint { 
     Type = type, 
     Feature = feature, 
     TableName = TableAliasGenerator.Generate(dataTablePrefix + extensionName + '_' + type.Name) 
 };
3. Make all column names in uppercase. Oracle creates columns with names as defined in a query, but when executing 'select' query Oracle makes all column names in uppercase. So any standard Orchard columns can't be accessed in Oracle. Changes must be done in Orchard.Data.Migration.Schema.ColumnCommand:
private string columnName; 
public string ColumnName 
{ 
  get { return columnName; } 
  set { columnName = value.ToUpper(); } 
}

4. Add quotes to the key identifier. Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(CreateTableCommand command) function:

builder.Append(_dialect.PrimaryKeyString) .Append(" ( ") .Append(String.Join(", ", primaryKeys.Select(key => "\"" + key + "\"").ToArray())) .Append(" )");
5. Replace NVARCHAR2 data type with VARCHAR2 in all 'create table' queries. Some columns in Orchard have type NVARCHAR2(2048) and Oracle is restricted at NVARCHAR2(2000). VARCHAR2 should be used instead of NVARCHAR2.

Add to the end of Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.GetTypeName function:

if (_dialect is NHibernate.Dialect.Oracle9iDialect) 
{ 
     result = result.Replace("NVARCHAR2", "VARCHAR2"); 
}//result - is a return value
6. Rename (using 'Refactor->Rename') Number to Number_ in Orchard.ContentManagement.Records.ContentItemVersionRecord. And do it manually in Orchard.ContentManagement.DataMigrations.FrameworkDataMigration. Reason:"Number" is a reserved word in OracleDB.

Expected changes are in:

  Orchard.ContentManagement.Records.ContentItemVersionRecord

  Orchard.ContentManagement.DataMigrations.FrameworkDataMigration

  Orchard.Tests.ContentManagement.DefaultContentManagerTests

  Orchard.ContentManagement.ContentItem

  Orchard.ContentManagement.DefaultContentManager

7. Oracle DB doesn't support empty strings (empty == null). To workaround this changes should be done in Orchard.Alias.Implementation.Updater.AliasHolderUpdater.Refresh function:

_aliasHolder.SetAliases(aliases.Select(alias => new AliasInfo { Path = alias.Item1 ?? string.Empty, Area = alias.Item2, RouteValues = alias.Item3 }));

8. Implement data provider Orchard.Data.Providers.OracleDataServiceProvider (similar to MySqlDataServiceProvider)

9. Apply OracleDataServiceProvider

     a) Add in Orchard.Setup.Index.cshtml:

<div> 
    @Html.RadioButtonFor(svm => svm.DatabaseProvider, Orchard.Setup.Controllers.SetupDatabaseType.Oracle.ToString(), new { id = "oracle" }) 
    <label for="oracle" class="forcheckbox">@T("Use an existing Oracle database")</label> 
</div>
     b) Add 'Oracle' value to Orchard.Setup.Controllers.SetupDatabaseType enum

     c) Add to Orchard.Setup.Controllers.SetupController.IndexPOST function the following code:

case SetupDatabaseType.Oracle: 
       providerName = "Oracle"; 
break;

Your suggestions? How to simplify this Oracle adaptation?

Jan 21, 2013 at 6:48 AM

I follow this and run fault, it only created a 'Orchard_Framework_DataMigrat‘ table

 

Setup failed: could not execute query 
[ select Id18_,DataMigr2_18_,Version18_ from ( select datamigrat0_.Id as Id18_, datamigrat0_.DataMigrationClass as DataMigr2_18_, datamigrat0_.Version as Version18_ from Orchard_Framework_DataMigrat datamigrat0_ where datamigrat0_.DataMigrationClass=:p0 ) where rownum <=1 ] 
Name:p1 - Value:Orchard.Core.Settings.Migrations 
[SQL: select Id18_,DataMigr2_18_,Version18_ from ( select datamigrat0_.Id as Id18_, datamigrat0_.DataMigrationClass as DataMigr2_18_, datamigrat0_.Version as Version18_ from Orchard_Framework_DataMigrat datamigrat0_ where datamigrat0_.DataMigrationClass=:p0 ) where rownum <=1]

 

Jan 21, 2013 at 8:18 AM

Ok, I Fixed it ,and it runs OK

but, when it is running , it created lots of logs in the debug log file(no error log file),  can you give me some advise?

 

2013-01-21 17:10:20,246 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,778 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,804 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,938 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction

Jan 21, 2013 at 6:31 PM

Question to Orchard Steering Committee: any chance to include Oracle DB support in Orchard out of box?

Jan 24, 2013 at 5:18 AM

I follow this summary, but why I get a "Setup failed: ORA-02089: COMMIT ..."

Jan 24, 2013 at 5:19 AM

I follow this summary, but why I get a "Setup failed: ORA-02089: COMMIT ..."

Jan 24, 2013 at 6:46 PM

What is in the log?

You can check the correctness of changes by initializing Orchard with a built-in database.

Jan 25, 2013 at 12:39 AM

I test  initializing Orchard  with sql server, ande it work. But when I initializing it use the Oracle, it can't and show "Setup failed: ORA-02089". I debug it, and I find when sqlStatement contains "create table", the command.ExecuteNonQuery() throw exception.

Jan 25, 2013 at 7:20 AM
slimjack wrote:

What is in the log?

You can check the correctness of changes by initializing Orchard with a built-in database.

It is the logs.  Other DB is running normally,

2013-01-21 17:10:20,246 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,778 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,804 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,938 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
Jan 25, 2013 at 8:39 AM
Edited Jan 25, 2013 at 8:40 AM
ibrady wrote:
slimjack wrote:

What is in the log?

You can check the correctness of changes by initializing Orchard with a built-in database.

It is the logs.  Other DB is running normally,

2013-01-21 17:10:20,246 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,778 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,804 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction
2013-01-21 17:10:20,938 [12] NHibernate.Transaction.AdoTransaction - set a nonnull IDbCommand.Transaction to null because the Session had no Transaction

My last post was to GAUDJ.

As for these warnings - I have the same problem, but I don't know how to fix it.

Jan 25, 2013 at 1:42 PM

Do you use the method and install orchard in oracle success? Today I try again, but when I initialize Orachard, it still run error, I check the log ,it do not shows anything, Could you send your sourcecode to me? I want to check if I change something wrong, My Email is gaodaojing@gmail.com,Thanks!

Feb 12, 2013 at 1:27 PM
I dont know why but I get a "Setup failed: ORA-02089: COMMIT is not allowed in a subordinate session" and nothing in the log :'(

Please is someone can explain me how to fix that ?

Thanks in advance
Feb 15, 2013 at 10:34 AM
Edited Feb 15, 2013 at 10:37 AM
Done ! It's works like a charm !

In AMV-Orchard\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs
public override void Visit(CreateTableCommand command) {
    if (ExecuteCustomInterpreter(command)) {
        return;
    }
    var builder = new StringBuilder();
    builder
        .Append("DECLARE pragma autonomous_transaction; BEGIN EXECUTE immediate '")
        .Append(_dialect.CreateMultisetTableString)
        .Append(_dialect.QuoteForTableName(PrefixTableName(command.Name.ToUpper())))
        .Append(" (");
    var appendComma = false;
    foreach (var createColumn in command.TableCommands.OfType<CreateColumnCommand>()) {
        if (appendComma) {
            builder.Append(", ");
        }
        appendComma = true;
        Visit(builder, createColumn);
    }
    var primaryKeys = command.TableCommands.OfType<CreateColumnCommand>().Where(ccc => ccc.IsPrimaryKey).Select(ccc => ccc.ColumnName);
    if (primaryKeys.Any()) {
        if (appendComma) {
            builder.Append(", ");
        }
        builder.Append(_dialect.PrimaryKeyString)
            .Append(" ( ")
            .Append(String.Join(", ", primaryKeys.Select(key => "\"" + key + "\"").ToArray()))
            .Append(" )");
    }
    builder.Append(" )");
    builder.Append("'; END;");
    _sqlStatements.Add(builder.ToString());
    RunPendingStatements();
}
Feb 15, 2013 at 1:57 PM
Edited Feb 15, 2013 at 3:15 PM
I think It would be good to have Oracle DB support provided out of box. If you agree vote on issue:
http://orchard.codeplex.com/workitem/19409

and maybe we will find a way to have it implemented in one of next releases. Otherwise there will be obvious problems with upgrades.
Feb 28, 2013 at 2:52 PM
I agree that Oracle support out of the box would be an invaluable feature that would definitely increase the adoption rate of Orchard in the enterprise, which can only be a good thing for the community!
Apr 10, 2013 at 7:23 PM
Aug 11, 2013 at 7:09 AM
To make it easy, I made a patch for Orchard v1.7:
https://orchardoracle.codeplex.com/
Sep 24, 2013 at 4:30 PM
a patch for Orchard v1.7.1 was made.
https://orchardoracle.codeplex.com/releases/view/112521