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 emad
26●29●29●31
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
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.
I see. Will be waiting for the further reports then.
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.
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.
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)
I'm thinking of the following possible workaround:
Say, before the refactoring we had a table
Person
with a columnDepartment.Id
. After the refactoring it should have a new name, sayAccountOption.Department.Id
, whereAccountOption
is the name of a structure field inPerson
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.
Hello Dmitri, please inform me about the time where this issue should be solved as we are facing it regularly.
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.