﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>CapableObjects Forums / ECO / General discussions  / System.InvalidOperationException - Can only end subscription for active context / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>CapableObjects Forums</description><link>http://www.capableobjects.com/apps/InstantForum414/</link><webMaster>forums@capableobjects.com</webMaster><lastBuildDate>Wed, 08 Feb 2012 22:53:01 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>I also got this exception: Eco5, WPF in this context:&lt;br&gt;&lt;br&gt;var listAlleKinderGeraete = Geraet.AlleKindGeraete;&lt;br&gt;if (listAlleKinderGeraete.Contains(currGeraet))&lt;br&gt;  //  Do smth.&lt;br&gt;&lt;br&gt;where AlleKindGeraete is recursive derived association end. After I changed to this:&lt;br&gt;&lt;br&gt;var listAlleKinderGeraete = new List&lt;Geraet&gt;();&lt;br&gt;listAlleKinderGeraete.AddRange(Geraet.AlleKindGeraete);&lt;br&gt;if (listAlleKinderGeraete.Contains(currGeraet))&lt;br&gt;  //  Do smth.&lt;br&gt;&lt;br&gt;I havn't had this exception any more.&lt;br&gt;&lt;br&gt;The casll stack:&lt;br&gt;&lt;br&gt;System.InvalidOperationException was unhandled by user code&lt;br&gt;  Message="Can only end subscription for active context"&lt;br&gt;  Source="Eco.Handles"&lt;br&gt;  StackTrace:&lt;br&gt;       bei Eco.Services.Impl.AutoSubscriptionServiceImpl.EndSubscribe(AutoSubscriptionContextImpl context) in e:\dev\Eco5.x\source\Eco\Eco.Handles\ServicesImpl\AutoSubscriptionServiceImpl.cs:Zeile 88.&lt;br&gt;       bei Eco.Services.Impl.AutoSubscriptionContextImpl.Dispose() in e:\dev\Eco5.x\source\Eco\Eco.Handles\ServicesImpl\AutoSubscriptionServiceImpl.cs:Zeile 43.&lt;br&gt;       bei Eco.Ocl.Impl.OclServiceImpl.BaseEvaluateAndSubscribe(IElement root, IClassifier Context, IExternalVariableList vars, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber) in e:\dev\Eco5.x\source\Eco\Eco.Handles\FrameworkImpl\Ocl\Ocl.cs:Zeile 433.&lt;br&gt;       bei Eco.Ocl.Impl.OclServiceImpl.EvaluateAndSubscribe(IElement root, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber) in e:\dev\Eco5.x\source\Eco\Eco.Handles\FrameworkImpl\Ocl\Ocl.cs:Zeile 466.&lt;br&gt;       bei Eco.Framework.OclDerivedMember.DoDeriveAndSubscribe(Boolean subscribe) in e:\dev\Eco5.x\source\Eco\Eco.Handles\Interfaces\DerivedMembers.cs:Zeile 165.&lt;br&gt;       bei Eco.Support.Deriver.AbstractDeriver.set_DeriverState(State value) in e:\dev\Eco5.x\source\Eco\Eco.Handles\Deriver\AbstractDeriver.cs:Zeile 126.&lt;br&gt;       bei Eco.Support.Deriver.AbstractDeriver.Derive() in e:\dev\Eco5.x\source\Eco\Eco.Handles\Deriver\AbstractDeriver.cs:Zeile 199.&lt;br&gt;       bei Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() in e:\dev\Eco5.x\source\Eco\Eco.Handles\Deriver\AbstractDeriver.cs:Zeile 185.&lt;br&gt;       bei Eco.Framework.DerivedMember.get_Value() in e:\dev\Eco5.x\source\Eco\Eco.Handles\Interfaces\DerivedMembers.cs:Zeile 89.&lt;br&gt;       bei Eco.Framework.DerivedMemberManager.GetMemberValue(IProperty prop) in e:\dev\Eco5.x\source\Eco\Eco.Handles\Interfaces\DerivedMembers.cs:Zeile 351.&lt;br&gt;       bei Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Locator locator) in e:\dev\Eco5.x\source\Eco\Eco.Handles\FrameworkImpl\Frontside\DerivedMemberFrontsidePolicies.cs:Zeile 31.&lt;br&gt;       bei Eco.Framework.Impl.Frontside.FrontsideDerivedMultilinkAdapter`1.GetList() in e:\dev\Eco5.x\source\Eco\Eco.Handles\FrameworkImpl\Frontside\FrontsideMultilinkAdapters.cs:Zeile 305.&lt;br&gt;       bei Eco.Framework.Impl.Frontside.FrontsideDerivedMultilinkAdapter`1.InternalContains(Object value) in e:\dev\Eco5.x\source\Eco\Eco.Handles\FrameworkImpl\Frontside\FrontsideMultilinkAdapters.cs:Zeile 366.&lt;br&gt;       bei Eco.Framework.Impl.Frontside.FrontsideDerivedMultilinkAdapter`1.Contains(T value) in e:\dev\Eco5.x\source\Eco\Eco.Handles\FrameworkImpl\Frontside\FrontsideMultilinkAdapters.cs:Zeile 453.&lt;br&gt;       bei Frako.Emvis.Model.GeraetAdapter.GetAlarmListeForExterneAlarme(IEnumerable parExterneAlarme, IEnumerable&amp; parAlarme) in D:\Frako-Projekte\Emvis\Frako.Emvis\Model\GeraetAdapter.cs:Zeile 605.&lt;br&gt;       bei Frako.Emvis.Model.Geraet.GetAlarmeForZeitIntervall(ZeitIntervall parZeitIntervall, Boolean parIfNeueAlarme, IEnumerable&amp; parAlarme) in D:\Frako-Projekte\Emvis\Frako.Emvis\Model\Geraet.cs:Zeile 119.&lt;br&gt;       bei Frako.Emvis.Model.Geraet.RefreshAlarmeInSortedList(ZeitIntervall[] parZIList, Boolean parIfNeueAlarme, IEnumerable&amp; parAlarme) in D:\Frako-Projekte\Emvis\Frako.Emvis\Model\Geraet.cs:Zeile 140.&lt;br&gt;       bei Frako.Emvis.EcoSchnittstelleAuswertungenHistorie.EcoHandlesAuswertungHistorieComponent.GetDatenAlarme(Object sender, DoWorkEventArgs e) in D:\Frako-Projekte\Emvis\Frako.Emvis\Frako.Emvis.EcoSchnittstelleAuswertungenHistorie\EcoHandlesAuswertungHistorieComponent.cs:Zeile 929.&lt;br&gt;       bei System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)&lt;br&gt;       bei System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)&lt;br&gt;  InnerException: &lt;br&gt;</description><pubDate>Thu, 21 Jul 2011 12:54:13 GMT</pubDate><dc:creator>efim</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>[quote][b]HansKarlsen (2011-05-17)[/b][hr]No I cannot explain why the Fetch - that goes into external code (ado db access)- then comes back as RenderedTuplePropertyDescriptor.GetValue...&lt;br&gt;&lt;br&gt;What kind of UI is it - WPF? Winforms?&lt;br&gt;&lt;br&gt;ECO6?&lt;br&gt;&lt;br&gt;Are you using the DispatchTaskToMainThread that is the Async fetch strategy introduced with Silverlight? (EcoServiceHelper.GetAsyncSupportService)&lt;br&gt;&lt;br&gt;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...[/quote]&lt;br&gt;&lt;br&gt;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.</description><pubDate>Wed, 18 May 2011 09:30:17 GMT</pubDate><dc:creator>Pawel</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>No I cannot explain why the Fetch - that goes into external code (ado db access) - then comes back as RenderedTuplePropertyDescriptor.GetValue...&lt;/P&gt;&lt;P&gt;What kind of UI is it - WPF? Winforms?&lt;/P&gt;&lt;P&gt;ECO6?&lt;/P&gt;&lt;P&gt;Are you using the DispatchTaskToMainThread that is the Async fetch strategy introduced with Silverlight? (EcoServiceHelper.GetAsyncSupportService)&lt;/P&gt;&lt;P&gt;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...</description><pubDate>Tue, 17 May 2011 23:37:59 GMT</pubDate><dc:creator>HansKarlsen</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>[ECO 6.0.0.5120]&lt;br&gt;We have random Eco.Framework.MemberDeriveException with message "Member XXX.YYY is recursively derived". We don't have reproducible case.&lt;br&gt;&lt;br&gt;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.&lt;br&gt;&lt;br&gt;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 ([b]the line in bold[/b]). I think this may lead us to the roots of the problem.&lt;br&gt;&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMember.HandleRecursiveDerive() Line 63 + 0xea bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() Line 183 + 0x10 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMember.Value.get() Line 89 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMemberManager.GetMemberValue(Eco.ObjectRepresentation.IProperty prop) Line 351 + 0xb7 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Eco.Cache.Locator locator) Line 31 + 0xd7 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 36 + 0xf bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DefaultFrontsideLocator.get_MemberByIndex(int index) Line 319 + 0x18 bytes	C#&lt;br&gt;&gt;	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.Line1.get() Line 141 + 0x3b bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.OfferedService.RelationFromDerive(ref string res) Line 63 + 0xc0 bytes	C#&lt;br&gt; 	[External Code]&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.CodeAutoDerivedMember.DoDeriveAndSubscribe(bool subscribe) Line 250 + 0x77 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.DeriverState.set(Eco.Support.Deriver.AbstractDeriver.State value) Line 116 + 0x10 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.Derive() Line 199 + 0xf bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() Line 185 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMember.Value.get() Line 89 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMemberManager.GetMemberValue(Eco.ObjectRepresentation.IProperty prop) Line 351 + 0xb7 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Eco.Cache.Locator locator) Line 31 + 0xd7 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 36 + 0xf bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.GetAsObject() Line 60 + 0x39 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.AsObject.get() Line 38 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Handles.RenderedTupleProperty.DoGetValue() Line 1948 + 0x4c bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Handles.AbstractRenderedTupleProperty.GetValue() Line 1884 + 0x13 bytes	C#&lt;br&gt; 	[b]Eco.Handles.dll!Eco.Handles.RenderedTuplePropertyDescriptor.GetValue(object component) Line 1390 + 0x26 bytes	C#[/b]&lt;br&gt; 	[External Code]&lt;br&gt; 	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#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DefaultImpl.PersistenceHandlerImpl.Fetch(System.Collections.Generic.ICollection&lt;Eco.Cache.Locator&gt; locators, int[] members, Eco.Framework.FetchStrategy fetchStrategy) Line 367 + 0x5e bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberFrontsidePolicy.MakeDbCurrent(Eco.Cache.Locator loc, Eco.Framework.FetchStrategy FetchStrategy) Line 134 + 0x9e bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberFrontsidePolicy.EnsureContentsCurrent(Eco.Cache.Locator locator) Line 109 + 0x48 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.SingleAssociationEndFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 25 + 0x15 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DefaultFrontsideLocator.get_MemberByIndex(int index) Line 319 + 0x18 bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.DSWaggonGroup.FromStation.get() Line 100 + 0x3b bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.DSWaggonGroup.GetLine1() Line 25 + 0xd bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.Line1Derive(ref string res) Line 53 + 0x1d bytes	C#&lt;br&gt; 	[External Code]	&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.CodeAutoDerivedMember.DoDeriveAndSubscribe(bool subscribe) Line 250 + 0x77 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.DeriverState.set(Eco.Support.Deriver.AbstractDeriver.State value) Line 116 + 0x10 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.Derive() Line 199 + 0xf bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Support.Deriver.AbstractDeriver.EnsureCurrent() Line 185 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMember.Value.get() Line 89 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.DerivedMemberManager.GetMemberValue(Eco.ObjectRepresentation.IProperty prop) Line 351 + 0xb7 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.GetDerivedValue(Eco.Cache.Locator locator) Line 31 + 0xd7 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DerivedMemberFrontsidePolicy.RetrieveMemberValue(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 36 + 0xf bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.DefaultFrontsideLocator.get_MemberByIndex(int index) Line 319 + 0x18 bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.Line1.get() Line 141 + 0x3b bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.CostGroupDetail.get_MemberByIndex(int index) Line 77 + 0xa bytes	C#&lt;br&gt; 	Rcs.Eurad.Model.dll!Rcs.Eurad.Model.DSWaggonGroup.get_MemberByIndex(int index) Line 62 + 0xe bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberFrontsidePolicy.RetrieveMemberValueViaGetter(Eco.Framework.Impl.Frontside.DefaultFrontsideLocator locator) Line 139 + 0x47 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.GetAsObject() Line 59 + 0x3b bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Framework.Impl.Frontside.MemberPropertyAdapter.AsObject.get() Line 38 + 0xa bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Handles.RenderedTupleProperty.DoGetValue() Line 1948 + 0x4c bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Handles.AbstractRenderedTupleProperty.GetValue() Line 1884 + 0x13 bytes	C#&lt;br&gt; 	Eco.Handles.dll!Eco.Handles.RenderedTuplePropertyDescriptor.GetValue(object component) Line 1390 + 0x26 bytes	C#&lt;br&gt; 	[External Code]	&lt;br&gt; 	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#&lt;br&gt; 	Rcs.Core.Forms.dll!Rcs.Core.Forms.EcoFormsHelper.Find&lt;Rcs.Eurad.Model.CostGroup&gt;(Eco.ObjectRepresentation.IEcoServiceProvider ecoServiceProvider, out Eco.ObjectRepresentation.IObject foundObject, System.Collections.IDictionary searchParams) Line 191 + 0x79 bytes	C#&lt;br&gt; 	Rcs.Eurad.Common.dll!Rcs.Eurad.Common.FieldOrderedServiceWithCostGroupSetters.GetValue(object currValue, out object newValue, Eco.ObjectRepresentation.IEcoServiceProvider serviceProvider) Line 99 + 0x21 bytes	C#&lt;br&gt; 	Rcs.Core.Forms.dll!Rcs.Core.Forms.Import.ImpRecordsUserControl&lt;Rcs.Eurad.ImportExport.ImpExItemToOrder.ImportWagRecord&gt;.SetValue_Click(object sender, System.EventArgs e) Line 151 + 0x74 bytes	C#&lt;br&gt; 	[External Code]	&lt;br&gt; 	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#&lt;br&gt; 	Rcs.Eurad.Common.dll!Rcs.Eurad.Common.EuradMainForm.AImpExpExecute(object sender, System.EventArgs e) Line 459 + 0x79 bytes	C#&lt;br&gt; 	cdiese2.dll!CDiese.Actions.Action.OnItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) Line 308 + 0x29 bytes	C#&lt;br&gt; 	[External Code]	&lt;br&gt; 	Rcs.Core.Forms.dll!Rcs.Core.Forms.ApplicationContext.Run(string[] args, System.Type userApplicationType, bool singleInstance) Line 94 + 0xa bytes	C#&lt;br&gt; 	Eurad.exe!Rcs.Eurad.App.Main(string[] args) Line 79 + 0x3a bytes	C#&lt;br&gt; 	[External Code]	&lt;br&gt;</description><pubDate>Tue, 17 May 2011 12:57:25 GMT</pubDate><dc:creator>Pawel</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>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.&lt;br&gt;&lt;br&gt;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)</description><pubDate>Fri, 19 Mar 2010 08:19:28 GMT</pubDate><dc:creator>Jonas Hogstrom</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>Hello,&lt;br&gt;&lt;br&gt;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&lt;br&gt;Ocl.Evaluate(...).GetAsIList&lt;br&gt;to merely Ocl.Evaluate. After that we did not (yet) observe any problems.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Dmitry</description><pubDate>Fri, 19 Mar 2010 02:06:52 GMT</pubDate><dc:creator>Dmitry</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>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? &lt;br&gt;&lt;br&gt;If you are, you need to make sure that you use the following pattern:&lt;br&gt;&lt;br&gt;				using (AutoSubscriptionService.StartSubscribe(aSubscriber))&lt;br&gt;				{&lt;br&gt;					// do your stuff&lt;br&gt;				}&lt;br&gt;&lt;br&gt;this ensures that the result from the StartSubscribe-method is properly disposed and that will terminate the autosubscription. &lt;br&gt;&lt;br&gt;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.&lt;br&gt;&lt;br&gt;Do you get any exceptions in your app prior to this exception?</description><pubDate>Fri, 19 Mar 2010 00:39:14 GMT</pubDate><dc:creator>Jonas Hogstrom</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>I suddenly got the same problem in a completely different place with this call stack:&lt;br&gt;&lt;br&gt;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)&lt;br&gt;Eco.Internal.TBoldOclService                 |BaseEvaluateAndSubscribe(IElement root, IClassifier Context, IExternalVariableList vars, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber)|859[0] |&lt;br&gt;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)                                                                                                                                                  &lt;br&gt;&lt;br&gt;This time it happened on calculating a simple derived (r/o) attribute through OCL.&lt;br&gt;&lt;br&gt;This problem really becomes a showstopper... We cannot deliver to our clients an application which fails once every 5 or 10 runs...&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Dmitry</description><pubDate>Tue, 16 Mar 2010 03:33:42 GMT</pubDate><dc:creator>Dmitry</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>Can this bug be avoided by switching from a derived association to another method of fetching required objects?&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Dmitry</description><pubDate>Mon, 15 Mar 2010 16:31:37 GMT</pubDate><dc:creator>Dmitry</dc:creator></item><item><title>RE: System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>Random bugs, my absolute favourite ;)&lt;br&gt;&lt;br&gt;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...&lt;br&gt;</description><pubDate>Mon, 15 Mar 2010 09:27:44 GMT</pubDate><dc:creator>Jonas Hogstrom</dc:creator></item><item><title>System.InvalidOperationException - Can only end subscription for active context</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5001-4-1.aspx</link><description>Hello,&lt;br&gt;&lt;br&gt;A few clients reported a strange problem when an OCL query like this (Eco 4):&lt;br&gt;Ocl.Evaluate("HumanClientsRole.allInstances.AllObjects")&lt;br&gt;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.&lt;br&gt;&lt;br&gt;Below is a stack trace:&lt;br&gt;Eco.Services.Impl.AutoSubscriptionServiceImpl EndSubscribe(AutoSubscriptionContextImpl context)&lt;br&gt;Eco.Services.Impl.AutoSubscriptionContextImpl Dispose()&lt;br&gt;Eco.Internal.TBoldOclService BaseEvaluateAndSubscribe(IElement root, IClassifier Context, IExternalVariableList vars, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber)&lt;br&gt;Eco.Internal.TBoldOclService EvaluateAndSubscribe(IElement root, String expression, ISubscriber reevaluateSubscriber, ISubscriber resubscribeSubscriber) &lt;br&gt;Eco.Framework.OclDerivedMember DoDeriveAndSubscribe(Boolean subscribe)&lt;br&gt;Eco.Support.Deriver.AbstractDeriver set_DeriverState(State value)&lt;br&gt;Eco.Support.Deriver.AbstractDeriver Derive()&lt;br&gt;Eco.Support.Deriver.AbstractDeriver EnsureCurrent()&lt;br&gt;Eco.Framework.DerivedMember get_Value()&lt;br&gt;Eco.Framework.DerivedMemberManager GetMemberValue(IProperty prop)&lt;br&gt;Eco.Internal.DerivedMemberFrontsidePolicy GetDerivedValue(Locator locator)&lt;br&gt;Eco.Internal.FrontsideDerivedMultilinkAdapter`1 get_Count()&lt;br&gt;Eco.ObjectImplementation.ObjectListAdapter get_Count()&lt;br&gt;&lt;br&gt;If you have any ideas how to fix this, please share.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Dmitry&lt;br&gt;</description><pubDate>Sat, 13 Mar 2010 18:27:55 GMT</pubDate><dc:creator>Dmitry</dc:creator></item></channel></rss>
