Hello, an InvalidOperationException with message "Sequence contains no matching element" thrown during building database:

at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at Xtensive.Orm.Upgrade.HintGenerator.MapNestedFields(StoredFieldInfo oldField, StoredFieldInfo newField)
at Xtensive.Orm.Upgrade.HintGenerator.BuildFieldMapping(IEnumerable`1 renames, IEnumerable`1 typeChanges)
at Xtensive.Orm.Upgrade.HintGenerator.GenerateHints(IEnumerable`1 upgradeHints)
at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.BuildSchemaHints(StorageInfo extractedSchema, StorageInfo targetSchema)
at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.<>c__DisplayClass7.<CreateBuilderConfiguration>b__3(StorageInfo extractedSchema, StorageInfo targetSchema)
at Xtensive.Orm.Building.Builders.DomainBuilder.SynchronizeSchema(SchemaUpgradeMode schemaUpgradeMode)
at Xtensive.Orm.Building.Builders.DomainBuilder.BuildDomain(DomainConfiguration configuration, DomainBuilderConfiguration builderConfiguration)
at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.BuildStageDomain(UpgradeStage stage)
at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration)
at Microtech.Andalus.Business.DomainManager.BuildNewCompany(Company company) in D:\ahmad emad andalus work\AndalusNew\Framework\trunk\Microtech.Andalus.Business\Core\DomainManager.cs:line 303
at Microtech.Andalus.Business.DomainManager.BuildCompany() in D:\ahmad emad andalus work\AndalusNew\Framework\trunk\Microtech.Andalus.Business\Core\DomainManager.cs:line 77

the significant change we made was collecting 8 fields used in a lot of tables into an Structure and use the Structure in the table instead of separated fields:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xtensive.Orm;
using Microtech.Andalus.Business;
using Microtech.Infinity5.Model.Common;
using Microtech.Andalus.Business.BusinessUnitCore;
using Microtech.Infinity5.Model.Financial.GL;

namespace Microtech.Infinity5.Model.Operations.SC 
{

   public class GLAccountOption : Structure
   {
       [Field]
       public HierarchicalGLAccount Account { get; set; }

       [Field]
       public CostCenter CostCenter { get; set; }

       [Field]    
       public Department Department { get; set; }

       [Field]
       public Project Project { get; set; }

       [Field]
       public Location Location { get; set; }

       [Field]
       public BudgetSource BudgetSource { get; set; }

       [Field]
       public StatisticalCode StatisticalCode { get; set; }

       [Field]
       public Journal Journal { get; set; }        
   }

}

the database contains data and the following is the domain configration we are using:

<domain name="Company" upgradeMode="Perform" connectionUrl="sqlserver://sa:Thank$123@C010/CompanyDB16012012" validationMode="OnDemand">
            <sessions>
                <session name="Default" options="LegacyProfile,AllowSwitching,ReadRemovedObjects"/>
            </sessions>
            <types>
                <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Mask"/>
                <add assembly="Microtech.Andalus.Globalization"/>
                <add assembly="Microtech.Infinity5.Model"/>
                <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Workflow.Core"/>
            </types>
        </domain>

asked Feb 08 '12 at 10:39

ahmad%20emad's gravatar image

ahmad emad
26292931

edited Feb 10 '12 at 01:56

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

Hello Ahmad Emad,

Could you please specify which version of DataObjects.Net you use? I need exact build number which can be found in Xtensive.Orm.dll assembly properties.

Thanks

(Feb 10 '12 at 01:57) Dmitri Maximov Dmitri%20Maximov's gravatar image

Hello Dmitri, sorry for missing information, my version is 4.4.0 build 7249, but we have replaced its program files folder's files with build 7560(sent to us as a compressed folder so we extract it before replacing) according to your instructions due to error in removing.

Notes: we are currently in the state of upgrading to v 4.4.1 build 7999 so we will try the scenario after upgrading and inform you with the result.

(Feb 12 '12 at 04:17) ahmad emad ahmad%20emad's gravatar image

I see. Will be waiting for the further reports then.

(Feb 13 '12 at 07:16) Dmitri Maximov Dmitri%20Maximov's gravatar image

hello Dmitri, we have installed v 4.4.1 build 7999 and the exception happened again(actually before i test the new version with the previous scenario). after adding and removing some fields in addition to modify an enumeration by renaming and removing enumeration fields while tables contain some data the exception fired under the same web.config domain configration and giving the same exception and stack trace.

(Feb 27 '12 at 07:52) ahmad emad ahmad%20emad's gravatar image

Hello Ahmad Emad,

So evidently this is a bug and should be fixed. I'll register it in our internal bug tracker and notify you when the issue is worked out.

(Feb 28 '12 at 04:35) Dmitri Maximov Dmitri%20Maximov's gravatar image

Hello Dmitri, if there is any temp solution or something we can do to prevent this problem till you solve the bug, please inform me(as we have to publish on the customer site next Thursday)

(Feb 28 '12 at 08:09) ahmad emad ahmad%20emad's gravatar image

I'm thinking of the following possible workaround:

Say, before the refactoring we had a table Person with a column Department.Id. After the refactoring it should have a new name, say AccountOption.Department.Id, where AccountOption is the name of a structure field in Person class.

What if you try renaming the columns according to the new scheme that includes the name of a structure field? I understand that this might take some time, but this might work out the issue you have right now.

P.S.
Remember making a backup of the database beforehand.

(Feb 28 '12 at 09:24) Dmitri Maximov Dmitri%20Maximov's gravatar image

Hello Dmitri, please inform me about the time where this issue should be solved as we are facing it regularly.

(Nov 05 '12 at 03:41) ahmad emad ahmad%20emad's gravatar image

Hello Ahmad, could you please add example of entity (original and new version) that leads to the provided exception during upgrade. All relevant schema upgrade hints would be useful too. Thanks.

(Nov 06 '12 at 06:47) Denis Krjuchkov Denis%20Krjuchkov's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA