Page 1 of 1

Upgrade 7.0.6 to Gold R8 error

Posted: Tue Feb 17, 2015 6:25 am
by AbleMods
We tried upgrading a 7.0.6 install to Gold R8 today and upgrade.aspx kept throwing this error. Any ideas?
Server Error in '/storegold' Application.

null id in CommerceBuilder.Catalog.Webpage entry (don't flush the Session after an exception occurs)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.AssertionFailure: null id in CommerceBuilder.Catalog.Webpage entry (don't flush the Session after an exception occurs)

Source Error:


Line 95: storeUrlSt.FieldValue = storeUrl;
Line 96: }
Line 97: storeUrlSt.Save();
Line 98:
Line 99: //store.Settings.Save();

Source File: c:\Sites\storegold\Install\Upgrade.aspx.cs Line: 97

Stack Trace:


[AssertionFailure: null id in CommerceBuilder.Catalog.Webpage entry (don't flush the Session after an exception occurs)]
NHibernate.Event.Default.DefaultFlushEntityEventListener.CheckId(Object obj, IEntityPersister persister, Object id, EntityMode entityMode) +267
NHibernate.Event.Default.DefaultFlushEntityEventListener.GetValues(Object entity, EntityEntry entry, EntityMode entityMode, Boolean mightBeDirty, ISessionImplementor session) +95
NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event) +139
NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event) +448
NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event) +303
NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) +161
NHibernate.Impl.SessionImpl.Flush() +501
CommerceBuilder.DomainModel.RepositoryWithTypedId`2.Save(TEntity item) +483

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
CommerceBuilder.DomainModel.EntityWithTypedId`1.Save() +605
Install_Upgrade.UpgradeButton_Click(Object sender, EventArgs e) in c:\Sites\trustedtours_com\storegold\Install\Upgrade.aspx.cs:97
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3554

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

Re: Upgrade 7.0.6 to Gold R8 error

Posted: Tue Feb 17, 2015 8:06 am
by AbleMods
Figured it out. SQL replication is somehow interfering with nHibernate.

Is Able's implementation of nHibernate compatible with SQL replication?

Re: Upgrade 7.0.6 to Gold R8 error

Posted: Tue Feb 17, 2015 12:43 pm
by Katie
SQL replication? I'm not sure what that means. Are you restoring a backup of the AC7 database, or something different?

Re: Upgrade 7.0.6 to Gold R8 error

Posted: Tue Feb 17, 2015 2:32 pm
by AbleMods
The full version of SQL Server supports a feature called "replication". SQL replication is used to maintain a real-time copy of a specific database on a separate SQL server. Every transaction committed to the primary 'publisher' is replicated and applied to the copy known as the 'subscriber'.

You can even have multiple subscribers to a single publisher. This would allow you to distribute the live database across multiple secondary database servers elsewhere in your hosting environment.

Having a real-time database replicated to a second database server allows you to offload heavy-workload reporting and queries. That way your big reports don't slow down the production SQL box.

In this client scenario, we are using it for fault tolerance. We have two SQL servers running on the network. The DB1 server is the primary and where all the Able sites store their data. Each DB1 database is configured to replicate every change to a copy of that database found on DB2.

In the event that DB1 goes down, we simply edit the database.config files and point all the sites to DB2. All sites are back up within seconds and the data completely matches the moment DB1 went down. No scrambling to find the last full backup, no searching for transaction log backups, no waiting for a server restore.

SQL replication can even be configured as a two-way street. Any changes to DB2 will automatically be replicated back to DB1 once the DB1 server becomes available again.

Re: Upgrade 7.0.6 to Gold R8 error

Posted: Tue Feb 17, 2015 3:20 pm
by Katie
That seems like a really nice feature, especially from a service provider's perspective.

I found this error reported before here - viewtopic.php?f=65&t=17630

It looks like we made some change to the upgrade script, but that was in Gold R7, so you should have had those changes already. I wonder if Gold R9 would work any better.

Re: Upgrade 7.0.6 to Gold R8 error

Posted: Tue Feb 17, 2015 3:48 pm
by AbleMods
Yea when it works LOL

I think that post you linked was mostly due to script timeouts for larger databases. Ran into that before, this one is different.

Might be worth a little internal testing if the devs have two SQL boxes available. Only one (the publisher) has to be full SQL Server. Subscriber boxes can be SQL Express.