eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. ๐—น๐—ถ๐—ป๐—ธ๐—ฒ๐—ฑ๐—ถ๐—ป.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ, ๐˜†๐—ผ๐˜‚๐˜๐˜‚๐—ฏ๐—ฒ.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ and ๐˜๐˜„๐—ถ๐˜๐˜๐—ฒ๐—ฟ @๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ and or simply ๐—ฆ๐˜๐—ฎ๐—ฟ/๐˜„๐—ฎ๐˜๐—ฐ๐—ต this repository and get notified from ๐—š๐—ถ๐˜๐—›๐˜‚๐—ฏ
http://expand.expandframework.com
Microsoft Public License
221 stars 115 forks source link

ObjectDisposedException in SequenceGenerator #764

Closed CWolffIF closed 3 years ago

CWolffIF commented 4 years ago

After a time I get the ObjectDisposedException error. Maybe it is affected by the Autitrail.

iXISXRM.Win.exe Error: 0 : 04.09.20 15:39:46.066 ================================================================================ The error occurred:

Type:       ObjectDisposedException
Message:    Auf das verworfene Objekt kann nicht zugegriffen werden.

Objektname: "DevExpress.Xpo.UnitOfWork(57)". Data: 0 entries Stack trace:

bei DevExpress.Xpo.Session.Connect() bei DevExpress.Xpo.Session.get_ObjectLayer() bei DevExpress.Xpo.Session.get_DataLayer() bei DevExpress.Persistent.AuditTrail.AuditDataStore2.Save(Session session, List1 itemsToSave, IAuditTimestampStrategy timestampStrategy, String currentUserName) bei DevExpress.Persistent.AuditTrail.AuditTrailService.SaveAuditDataByDefault(Session session, List1 itemsToSave) bei DevExpress.Persistent.AuditTrail.AuditTrailService.InternalSaveAuditData(Session session, List1 itemsToSave) bei DevExpress.Persistent.AuditTrail.AuditTrailService.SaveAuditData(Session session) bei DevExpress.ExpressApp.AuditTrail.Helpers.AuditTrailHelper.ObjectSpace_Committed(Object sender, EventArgs e) bei System.EventHandler.Invoke(Object sender, EventArgs e) bei DevExpress.ExpressApp.BaseObjectSpace.OnCommitted() bei DevExpress.ExpressApp.BaseObjectSpace.CommitChanges() bei Xpand.XAF.Modules.SequenceGenerator.SequenceGeneratorService.<>c__DisplayClass25_1.b_5(Object o) in D:\a\1\s\src\Modules\SequenceGenerator\SequenceGeneratorService.cs:Zeile 195. bei System.Reactive.Linq.ObservableImpl.Do`1.OnNext..OnNext(TSource value) in /_/Rx.NET/Source/src/System.Reactive/Linq/Observable/Do.cs:Zeile 38. InnerException is null

apobekiaris commented 4 years ago

can u test it without the audittrail? if we do not have exact repro steps resolving it can be the game of 20 questions

CWolffIF commented 4 years ago

In my DEMO Project it works with Audittrail and without Audittrail. How can I debug it in my main project ? The error comes once per View and than never again in the same View.

The error appears even if no View is open.

apobekiaris commented 4 years ago

the symbols are distributed, I am sure you are aware of this you only need to enabled them and set the Break On Error

https://github.com/eXpandFramework/eXpand/wiki/HowToDebug

  1. do u have issues doing so?
  2. can u reproduce it consistently in your production app? maybe u can share the app in private?
CWolffIF commented 4 years ago

Hi Tolis, the symbols are loaded, but how to "set the Break On Error"?

apobekiaris commented 4 years ago

VS menu debug/windows/exception settings and then check the CLR exception this will break on the exception location

image

note debugging this module is not trivial at all

apobekiaris commented 4 years ago

i would load the XAF symbols as described in https://github.com/eXpandFramework/DevExpress.XAF/wiki/How-to-boost-your-DevExpress-Debugging-Experience then add a breakpoint into the dispose of the UnitOfWork and try to see what is happening.

CWolffIF commented 4 years ago

Maybe my screenshot helps. "o" is null. There is a unitofwork in "space" but is seemed to be allready disposed. Unbenannt

apobekiaris commented 4 years ago

i understand where it throws I could blind safe guard it however I prefer to see what happens before and your post does not help.

After a time

what the log says?

CWolffIF commented 4 years ago

Hi Tolis,

thanks for your help. I think I got it. "After a time" was the key. When I run the app and do nothing than after a time the error occurs. So I looked in all timed events and I found code that a derived Session dispose. I donยดt know why at all und I donยดt why the code runs in 20.1.402. But this the error.

apobekiaris commented 4 years ago

since you closed the case, my understanding is that is not relate to the module?

CWolffIF commented 4 years ago

Yes you are right.

There is an error in my code. In 20.1.402 it works without error, in 20.1.70x not. But the reason was in my code.

apobekiaris commented 4 years ago

unfortunately it loks like the #737 fix causes issues

expand commented 4 years ago

The pre-release 2.201.15.4 in the DevExpress.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all.

Released packages: 1. [Xpand.Extensions v.2.202.47.1](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions) 1. [Xpand.Extensions.Mono.Cecil v.2.202.42.1](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Mono.Cecil) 1. [Xpand.Extensions.Office.Cloud v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Office.Cloud) 1. [Xpand.Extensions.Reactive v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Reactive) 1. [Xpand.Extensions.XAF v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.XAF) 1. [Xpand.Extensions.XAF.Xpo v.2.202.44.1](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.XAF.Xpo) 1. [Xpand.XAF.Core.All v.2.202.39.4](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Modules.AutoCommit v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/AutoCommit) 1. [Xpand.XAF.Modules.CloneMemberValue v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneMemberValue) 1. [Xpand.XAF.Modules.CloneModelView v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneModelView) 1. [Xpand.XAF.Modules.GridListEditor v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/GridListEditor) 1. [Xpand.XAF.Modules.HideToolBar v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/HideToolBar) 1. [Xpand.XAF.Modules.LookupCascade v.2.202.50.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/LookupCascade) 1. [Xpand.XAF.Modules.MasterDetail v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/MasterDetail) 1. [Xpand.XAF.Modules.ModelMapper v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelMapper) 1. [Xpand.XAF.Modules.ModelViewInheritance v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelViewInheritance) 1. [Xpand.XAF.Modules.Office.Cloud.Google v.2.202.9.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google) 1. [Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.2.202.6.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google.Tasks) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft v.2.202.49.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar v.2.202.20.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Calendar) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo v.2.202.19.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Todo) 1. [Xpand.XAF.Modules.OneView v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/OneView) 1. [Xpand.XAF.Modules.PositionInListView v.2.202.19.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/PositionInListView) 1. [Xpand.XAF.Modules.ProgressBarViewItem v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ProgressBarViewItem) 1. [Xpand.XAF.Modules.Reactive v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive) 1. [Xpand.XAF.Modules.Reactive.Logger v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger) 1. [Xpand.XAF.Modules.Reactive.Logger.Client.Win v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Client.Win) 1. [Xpand.XAF.Modules.Reactive.Logger.Hub v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Hub) 1. [Xpand.XAF.Modules.Reactive.Win v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Win) 1. [Xpand.XAF.Modules.RefreshView v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/RefreshView) 1. [Xpand.XAF.Modules.SequenceGenerator v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SequenceGenerator) 1. [Xpand.XAF.Modules.SuppressConfirmation v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SuppressConfirmation) 1. [Xpand.XAF.Modules.ViewEditMode v.2.202.48.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewEditMode) 1. [Xpand.XAF.Modules.ViewItemValue v.2.202.14.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewItemValue) 1. [Xpand.XAF.Modules.ViewWizard v.2.202.10.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewWizard) 1. [Xpand.XAF.Web.All v.2.202.39.4](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Win.All v.2.202.39.4](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules)

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.