Hello, According to Domain Resource Usage question's answer, I have upgraded to version 5.0.6 (after upgrade first to 5.0.5) to use StorageNode to use the same domain with many databases of the same structure. after modifying code to use StorageNode the following Exception being raised in old code when calling IsReferenced() method on an entity class: Exception Message:

Index was outside the bounds of the array.

StackTrace:

 at Xtensive.Orm.Linq.Materialization.MaterializationHelper.CreateSingleSourceMap(Int32 targetLength, Pair`1[] remappedColumns)
   at Xtensive.Orm.Linq.Materialization.MaterializationContext.GetTypeMapping(Int32 entityIndex, TypeInfo approximateType, Int32 typeId, Pair`1[] columns)
   at Xtensive.Orm.Internals.RecordSetReader.ParseColumnGroup(Tuple tuple, MaterializationContext context, Int32 groupIndex, RecordPartMapping mapping)
   at Xtensive.Orm.Internals.RecordSetReader.ParseRow(Tuple tuple, MaterializationContext context, RecordPartMapping[] recordPartMappings)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Xtensive.Orm.Rse.RecordSetExtensions.<ToEntities>d__a.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at Xtensive.Orm.Providers.SessionHandler.<GetReferencesToInternal>d__5.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
   at Xtensive.Core.EnumerableExtensions.IsNullOrEmpty[TItem](IEnumerable`1 items)
   at Xtensive.Orm.ReferenceFinder.IsReferenced(Entity target)
   at Microtech.Infinity5.Model.Financial.GL.Currency.IsUsed() in d:\Work\Application\Microtech.Infinity5.Model\Financial\GL\Currency.cs:line 307
   at Microtech.Infinity5.Web.Financial.GL.CurrencyForm.OnPreRenderComplete(EventArgs e) in d:\Work\Application\Microtech.Infinity5.Web\Financial\GL\CurrencyForm.aspx.cs:line 55
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks,

asked Sep 09 '15 at 10:01

ahmad%20emad's gravatar image

ahmad emad
26292931

Hello ahmad emad

Could you give me 1)body of Currency.IsUsed() 2)DomainConfiguration.DefaultDatabase if you set it 3)DomainConfiguration.DefaultSchema 4)DomainConfiguration.MappingRules if you have some rules 5)configurations of nodes?

You can post it here or send me on alexey.kulakov@dataobjects.net

(Sep 09 '15 at 10:47) Alexey Kulakov Alexey%20Kulakov's gravatar image

One Answer:

Hello Alexey, we doesn't use DefaultDatabase, DefaultSchema or MappingRules. here are the body of IsUsed method and configuration of domain and its nodes

IsUsed() method:

  public bool IsUsed()
        {
            return this.IsReferenced();
        }

NodeConfig:

 UrlInfo url = UrlInfo.Parse(companyDomainConfig.ConnectionInfo.ConnectionUrl.Protocol + "://" + company.UserName + ":" + company.Password + "@" + company.Server + "/" + company.Database + "");
                ConnectionInfo connection = new ConnectionInfo(url);
                var nodeConfiguration = new NodeConfiguration(ProviderTenant.Current);
nodeConfiguration.ConnectionInfo = connection;
nodeConfiguration.UpgradeMode = companyDomainConfig.UpgradeMode;
domain.StorageNodeManager.AddNode(nodeConfiguration);

Domain Configuration:

 <domain name="Company" upgradeMode="Validate" connectionUrl="sqlserver://sa:sa@publish-pc/infinityCompany?Connection Timeout=3000">
        <sessions>
          <session name="System" commandTimeout="3000" />
          <session name="Default" batchSize="1000000" options="LegacyProfile,AllowSwitching,ReadRemovedObjects,AutoSaveChanges " commandTimeout="3000" />
        </sessions>
        <types>
          <!-- Master-->
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Schedule" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.BusinessProcessLogging" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Business" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.DataDictionary" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Drilling" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Security" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.UserProfiles" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Workflow" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Reporting" />
          <!-- COmpany-->
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.AuditTrail" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Search" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Mask" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.DataDictionary.BusinessUnitUtilities" />
          <add assembly="Microtech.Andalus.Globalization" />
          <add assembly="Microtech.Infinity5.Model" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.AuditTrail.AuditLog" />
          <add assembly="Microtech.Andalus.Business" namespace="Microtech.Andalus.Formulas" />
        </types>
      </domain>

answered Sep 10 '15 at 01:03

ahmad%20emad's gravatar image

ahmad emad
26292931

It must be something with TypeId. There was a bug connected with TypeId in multi-storage domain. Try to use 5.0.7 RC version. If problem appears again than we'll continue the investigation.

(Oct 06 '15 at 03:47) Alexey Kulakov Alexey%20Kulakov's gravatar image

Thanks, solved after install 5.0.7 RC release, but we had to use database which wasn't build with release 5.0.5

(Nov 12 '15 at 01:06) ahmad emad ahmad%20emad's gravatar image
Your answer
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

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×1
×1
×1

Asked: Sep 09 '15 at 10:01

Seen: 7,063 times

Last updated: Nov 12 '15 at 01:06

Related questions

powered by OSQA