|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2012-01-13 15:57:45
Posts: 48,
Visits: 1 645
|
|
Hello,
A few clients reported a strange problem when an OCL query like this (Eco 4):
Ocl.Evaluate("HumanClientsRole.allInstances.AllObjects")
fails randomly on program startup with an exception "System.InvalidOperationException - Can only end subscription for active context". In all other places this query works fine. 'AllObjects' is a derived association.
Below is a stack trace:
Eco.Services.Impl.AutoSubscriptionServiceImpl EndSubscribe(AutoSubscriptionContextImpl context)
Eco.Services.Impl.AutoSubscriptionContextImpl Dispose()
Eco.Internal.TBoldOclService BaseEvaluateAndSubscribe(IElement root, IClassifier Context, IExternalVariableList vars, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber)
Eco.Internal.TBoldOclService EvaluateAndSubscribe(IElement root, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber)
Eco.Framework.OclDerivedMember DoDeriveAndSubscribe(Boolean subscribe)
Eco.Support.Deriver.AbstractDeriver set_DeriverState(State value)
Eco.Support.Deriver.AbstractDeriver Derive()
Eco.Support.Deriver.AbstractDeriver EnsureCurrent()
Eco.Framework.DerivedMember get_Value()
Eco.Framework.DerivedMemberManager GetMemberValue(IProperty prop)
Eco.Internal.DerivedMemberFrontsidePolicy GetDerivedValue(Locator locator)
Eco.Internal.FrontsideDerivedMultilinkAdapter`1 get_Count()
Eco.ObjectImplementation.ObjectListAdapter get_Count()
If you have any ideas how to fix this, please share.
Regards,
Dmitry
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
Random bugs, my absolute favourite 
It looks like an autosubscribe block has been lost somewhere, but without a reproducible case, it is hard to tell. If this is the case, it still sounds odd that it shouldn't behave the same all the time...
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2012-01-13 15:57:45
Posts: 48,
Visits: 1 645
|
|
Can this bug be avoided by switching from a derived association to another method of fetching required objects?
Regards,
Dmitry
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2012-01-13 15:57:45
Posts: 48,
Visits: 1 645
|
|
I suddenly got the same problem in a completely different place with this call stack:
Eco.Services.Impl.AutoSubscriptionServiceImpl|EndSubscribe(AutoSubscriptionContextImpl context) Eco.Services.Impl.AutoSubscriptionContextImpl|Dispose() Eco.Internal.DefaultFrontsideLocator |InvokeQuery(IMethod method, IElement[] parameters, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber) Eco.Ocl.Support.OclMethodBase |Evaluate(IOclOperationParameters oclParameters) Eco.Internal.TBoldOclEvaluatorVisitor |VisitTBoldOclOperation(TBoldOclOperation N) Eco.Internal.TBoldOclOperation |AcceptVisitor(TBoldOclVisitor V) Eco.Internal.TBoldOcl |InternalEvaluate(String Ocl, IElement RootElement, IClassifier Context, SubscriberPair SubscriberBlock, IExternalVariableList VariableList)
Eco.Internal.TBoldOclService |BaseEvaluateAndSubscribe(IElement root, IClassifier Context, IExternalVariableList vars, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber)|859[0] |
Eco.Internal.TBoldOclService |EvaluateAndSubscribe(IElement root, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber) Eco.Framework.OclDerivedMember |DoDeriveAndSubscribe(Boolean subscribe) Eco.Support.Deriver.AbstractDeriver |set_DeriverState(State value) Eco.Support.Deriver.AbstractDeriver |Derive() Eco.Support.Deriver.AbstractDeriver |EnsureCurrent() Eco.Framework.DerivedMember |get_Value() Eco.Framework.DerivedMemberManager |GetMemberValue(IProperty prop) Eco.Internal.DerivedMemberFrontsidePolicy |GetDerivedValue(Locator locator) Eco.Internal.DerivedMemberFrontsidePolicy |RetrieveMemberValue(Locator locator) Eco.Internal.TBoldMemberPropertyAdapter |GetAsObject() Eco.Internal.TBoldMemberPropertyAdapter |get_AsObject() Eco.Internal.TBoldAttributePropertyAdapter |get_AsObject() Eco.Framework.OclDerivedMember |DoDeriveAndSubscribe(Boolean subscribe) Eco.Support.Deriver.AbstractDeriver |set_DeriverState(State value) Eco.Support.Deriver.AbstractDeriver |Derive() Eco.Support.Deriver.AbstractDeriver |EnsureCurrent() Eco.Framework.DerivedMember |get_Value() Eco.Framework.DerivedMemberManager |GetMemberValue(IProperty prop) Eco.Internal.DerivedMemberFrontsidePolicy |GetDerivedValue(Locator locator) Eco.Internal.DerivedMemberFrontsidePolicy |RetrieveMemberValue(Locator locator) Eco.Internal.DefaultFrontsideLocator |get_MemberByIndex(Int32 index)
This time it happened on calculating a simple derived (r/o) attribute through OCL.
This problem really becomes a showstopper... We cannot deliver to our clients an application which fails once every 5 or 10 runs...
Regards,
Dmitry
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
It sounds like there is some bug in the autosubscription mechanism that leaves an unterminated undoblock that causes problems later on. Do you use the AutoSubscriptionService anywhere in your own code?
If you are, you need to make sure that you use the following pattern:
using (AutoSubscriptionService.StartSubscribe(aSubscriber))
{
// do your stuff
}
this ensures that the result from the StartSubscribe-method is properly disposed and that will terminate the autosubscription.
I double checked the code in ECO4 and ECO5 and as far as I can see, the calls in the ECO source are all correct.
Do you get any exceptions in your app prior to this exception?
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2012-01-13 15:57:45
Posts: 48,
Visits: 1 645
|
|
Hello,
We are not using the AutoSubscriptionService anywhere explicitly. Though for the last report I should tell that what was causing this exception was a typo in OCL expression in the derived attribute which led to self-recurrence. Regarding the first problem, though, there is nothing new - it usually works in that place (FormLoad event of the main form), and always works in other places. What we did, though, is we changed the line from
Ocl.Evaluate(...).GetAsIList
to merely Ocl.Evaluate. After that we did not (yet) observe any problems.
Regards,
Dmitry
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
Recursively calculated derived attributes can probably lead to stack overflows, and that has a nasty habit of showing up with all kinds of weird sideeffects. In ECO5, we detect recursively derived attributes and throw an exception directly.
It is strange that this error is so intermittent, I would have expected it to occur always or never. I'm sure there is a perfectly good explanation for this once we figure it out, but until then... Without a sample project that shows the problem, I'm afraid there is not much more I can do. I have checked the ECO code for incorrect usages of the autosubscription service, and there was none (that I could find)
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2012-02-01 10:36:37
Posts: 101,
Visits: 751
|
|
[ECO 6.0.0.5120]
We have random Eco.Framework.MemberDeriveException with message "Member XXX.YYY is recursively derived". We don't have reproducible case.
We suspect some threading issue fires grid cell value evaluation during another grid cell evaluation. When it happens that both grid cells represent derived members which ultimately derive from a single value - we get recursively derived exception.
Please look at the attached call-stack and try to shed some light on the issue. I don't understand why fetch operation leads to RenderedTuplePropertyDescriptor.GetValue() call (the line in bold). I think this may lead us to the roots of the problem.
Eco.Handles.dll!Eco.Framework.DerivedMember.HandleRecursiveDerive() Line 63 + 0xea bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() Line 183 + 0x10 bytes C#
Eco.Handles.dll!Eco.Framework.DerivedMember.Value.get() Line 89 + 0xa bytes C#
Eco.Handles.dll!Eco.Framework.DerivedMemberManager.GetMemberValue(Eco.ObjectRepresentation.IProperty prop) Line 351 + 0xb7 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Eco.Cache.Locator locator) Line 31 + 0xd7 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 36 + 0xf bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DefaultFrontsideLocator.get_MemberByIndex(int index) Line 319 + 0x18 bytes C#
> Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.Line1.get() Line 141 + 0x3b bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.OfferedService.RelationFromDerive(ref string res) Line 63 + 0xc0 bytes C#
[External Code]
Eco.Handles.dll!Eco.Framework.CodeAutoDerivedMember.DoDeriveAndSubscribe(bool subscribe) Line 250 + 0x77 bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.DeriverState.set(Eco.Support.Deriver.AbstractDeriver.State value) Line 116 + 0x10 bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.Derive() Line 199 + 0xf bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() Line 185 + 0xa bytes C#
Eco.Handles.dll!Eco.Framework.DerivedMember.Value.get() Line 89 + 0xa bytes C#
Eco.Handles.dll!Eco.Framework.DerivedMemberManager.GetMemberValue(Eco.ObjectRepresentation.IProperty prop) Line 351 + 0xb7 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Eco.Cache.Locator locator) Line 31 + 0xd7 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 36 + 0xf bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.GetAsObject() Line 60 + 0x39 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.AsObject.get() Line 38 + 0xa bytes C#
Eco.Handles.dll!Eco.Handles.RenderedTupleProperty.DoGetValue() Line 1948 + 0x4c bytes C#
Eco.Handles.dll!Eco.Handles.AbstractRenderedTupleProperty.GetValue() Line 1884 + 0x13 bytes C#
Eco.Handles.dll!Eco.Handles.RenderedTuplePropertyDescriptor.GetValue(object component) Line 1390 + 0x26 bytes C#
[External Code]
Eco.Persistence.dll!Eco.Persistence.Remoting.PersistenceMapperClient.ClientMapperImpl.Eco.Persistence.IPersistenceMapper.Fetch(Eco.DataRepresentation.ObjectIdList idList, out Eco.DataRepresentation.Datablock datablock, int[] memberIdList, Eco.Framework.FetchStrategy fetchStrategy) Line 157 + 0x43 bytes C#
Eco.Handles.dll!Eco.Framework.DefaultImpl.PersistenceHandlerImpl.Fetch(System.Collections.Generic.ICollection locators, int[] members, Eco.Framework.FetchStrategy fetchStrategy) Line 367 + 0x5e bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberFrontsidePolicy.MakeDbCurrent(Eco.Cache.Locator loc, Eco.Framework.FetchStrategy FetchStrategy) Line 134 + 0x9e bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberFrontsidePolicy.EnsureContentsCurrent(Eco.Cache.Locator locator) Line 109 + 0x48 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.SingleAssociationEndFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 25 + 0x15 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DefaultFrontsideLocator.get_MemberByIndex(int index) Line 319 + 0x18 bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.DSWaggonGroup.FromStation.get() Line 100 + 0x3b bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.DSWaggonGroup.GetLine1() Line 25 + 0xd bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.Line1Derive(ref string res) Line 53 + 0x1d bytes C#
[External Code]
Eco.Handles.dll!Eco.Framework.CodeAutoDerivedMember.DoDeriveAndSubscribe(bool subscribe) Line 250 + 0x77 bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.DeriverState.set(Eco.Support.Deriver.AbstractDeriver.State value) Line 116 + 0x10 bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.Derive() Line 199 + 0xf bytes C#
Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() Line 185 + 0xa bytes C#
Eco.Handles.dll!Eco.Framework.DerivedMember.Value.get() Line 89 + 0xa bytes C#
Eco.Handles.dll!Eco.Framework.DerivedMemberManager.GetMemberValue(Eco.ObjectRepresentation.IProperty prop) Line 351 + 0xb7 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Eco.Cache.Locator locator) Line 31 + 0xd7 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 36 + 0xf bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.DefaultFrontsideLocator.get_MemberByIndex(int index) Line 319 + 0x18 bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.Line1.get() Line 141 + 0x3b bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.get_MemberByIndex(int index) Line 77 + 0xa bytes C#
Rcs.Eurad.Model.dll!Rcs.Eurad.Model.DSWaggonGroup.get_MemberByIndex(int index) Line 62 + 0xe bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberFrontsidePolicy.RetrieveMemberValueViaGetter(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 139 + 0x47 bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.GetAsObject() Line 59 + 0x3b bytes C#
Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.AsObject.get() Line 38 + 0xa bytes C#
Eco.Handles.dll!Eco.Handles.RenderedTupleProperty.DoGetValue() Line 1948 + 0x4c bytes C#
Eco.Handles.dll!Eco.Handles.AbstractRenderedTupleProperty.GetValue() Line 1884 + 0x13 bytes C#
Eco.Handles.dll!Eco.Handles.RenderedTuplePropertyDescriptor.GetValue(object component) Line 1390 + 0x26 bytes C#
[External Code]
Rcs.Core.Forms.dll!Rcs.Core.Forms.SearchForm.Rcs.Core.Forms.ISearch.Find(out Eco.ObjectRepresentation.IObject foundObject, Eco.ObjectRepresentation.IEcoServiceProvider ecoServiceProvider, System.Collections.IDictionary searchParams) Line 518 + 0x26 bytes C#
Rcs.Core.Forms.dll!Rcs.Core.Forms.EcoFormsHelper.Find(Eco.ObjectRepresentation.IEcoServiceProvider ecoServiceProvider, out Eco.ObjectRepresentation.IObject foundObject, System.Collections.IDictionary searchParams) Line 191 + 0x79 bytes C#
Rcs.Eurad.Common.dll!Rcs.Eurad.Common.FieldOrderedServiceWithCostGroupSetters.GetValue(object currValue, out object newValue, Eco.ObjectRepresentation.IEcoServiceProvider serviceProvider) Line 99 + 0x21 bytes C#
Rcs.Core.Forms.dll!Rcs.Core.Forms.Import.ImpRecordsUserControl.SetValue_Click(object sender, System.EventArgs e) Line 151 + 0x74 bytes C#
[External Code]
Rcs.Core.Forms.dll!Rcs.Core.Forms.Import.PluginsControllerForm.Execute(Rcs.Core.Eco.Session.IEcoSession ecoSession, Eco.ObjectRepresentation.IEcoObject currentObject) Line 80 + 0x23 bytes C#
Rcs.Eurad.Common.dll!Rcs.Eurad.Common.EuradMainForm.AImpExpExecute(object sender, System.EventArgs e) Line 459 + 0x79 bytes C#
cdiese2.dll!CDiese.Actions.Action.OnItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) Line 308 + 0x29 bytes C#
[External Code]
Rcs.Core.Forms.dll!Rcs.Core.Forms.ApplicationContext.Run(string[] args, System.Type userApplicationType, bool singleInstance) Line 94 + 0xa bytes C#
Eurad.exe!Rcs.Eurad.App.Main(string[] args) Line 79 + 0x3a bytes C#
[External Code]
/Pawel
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2 days ago @ 17:12:46
Posts: 417,
Visits: 2 529
|
|
| No I cannot explain why the Fetch - that goes into external code (ado db access) - then comes back as RenderedTuplePropertyDescriptor.GetValue... What kind of UI is it - WPF? Winforms? ECO6? Are you using the DispatchTaskToMainThread that is the Async fetch strategy introduced with Silverlight? (EcoServiceHelper.GetAsyncSupportService) What kind of Grid is it? 3:th party? A Grid with threaded evaluation of cells must be a real "shoot me in the head" component... So I do not think that is the explanation...
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2012-02-01 10:36:37
Posts: 101,
Visits: 751
|
|
HansKarlsen (2011-05-17) No I cannot explain why the Fetch - that goes into external code (ado db access)- then comes back as RenderedTuplePropertyDescriptor.GetValue...
What kind of UI is it - WPF? Winforms?
ECO6?
Are you using the DispatchTaskToMainThread that is the Async fetch strategy introduced with Silverlight? (EcoServiceHelper.GetAsyncSupportService)
What kind of Grid is it? 3:th party? A Grid with threaded evaluation of cells must be a real "shoot me in the head" component... So I do not think that is the explanation...
It's ECO 6.0.0.5120 Winforms client application talking .Net remoting to a remote persistence server running as a windows service. No ViewModels, no silverlight, no DispatchTaskToMainThread. The grids are XtraGridControl from DevEx. We don't start additional threads.
/Pawel
|
|
|
|