Skocz do zawartości

Problem sfera nexto po aktualizacji do wersji 47.01

Polecane posty

Witam,

Po aktualizacji bibliotek i baz danych do wersji 47.01 przestała działac możliwośc przypisania podmiotu do zapisu w rejestrze vat:

 

var vatRegisterEntries = sphere.ZapisyWEwidencjiVAT();

IZapisWEwidencjiVAT vatRegisterEntry = vatRegisterEntries.Utworz();

vatRegisterEntry.UtworzPozycjeDomyslne()

 

 

Podmiot contrahent = contrahents.Dane.Pierwszy(p => p.NIP == document.Contrahent.VatId || p.NIPUE == nipUE);

 

vatRegisterEntry.UstawPodmiot(contrahent);

W powyższej linii dostaję błąd:

ConstraintException: The 'KorzystajZParametrowAutomatycznejDekretacji' property on 'Podmiot' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Boolean'. 

 

Sprawdzałem: pole w KorzystajZParametrowAutomatycznejDekretacji obiekcie contrahent nie jest puste i ma wartość false. NIe pomaga także ustawienie wartości ręcznie:

contrahent.UstawWartoscPola("KorzystajZParametrowAutomatycznejDekretacji", false);

 

Dodam że w wersji 46.1.1 wszystko działało bez problemu

 

Link to postu

Analiza kodu nie wskazuje na to, by w ogóle podobny problem powinien wystąpić 😞
Czy mógłbym otrzymać stacktrace z miejsca z którego leci wyjątek? Może być to po prostu zrzut ekranu z VisualStudio gdzie widoczny jest wyjątek wraz ze StackTrace prowadzącym do linii kodu w które wystąpił wyjątek.

Link to postu

Bardzo dzięuję za odpowiedź

 

Niestety czyszczenie QueryCache nic nie dało.

Poniżej stacktrace:

 

System.Reflection.TargetInvocationException
  HResult=0x80131604
  Message=Obiekt docelowy wywołania zgłosił wyjątek.
  Source=InsERT.Mox.Core
  StackTrace:
   at InsERT.Mox.BusinessObjects.BusinessObject`3.NavigationPropertyValidatingInternal(Object entity, String propertyName, String methodNameSuffix, IBusinessObjectPart part)
   at InsERT.Moria.EwidencjaVAT.ZapisWEwidencjiVATBO.NavigationPropertyValidatingCore(Object entity, String propertyName)
   at InsERT.Mox.BusinessObjects.BusinessObject`3.<>c__DisplayClass212_0.<AfterRelatedEntitySetPrivate>b__1()
   at InsERT.Mox.Aop.RuntimeWeavedJoinpoint.Proceed()
   at InsERT.Moria.BusinessResources.FlagiWlasne.FlagAssocChanged.Execute(IJoinpoint joinpoint)
   at InsERT.Mox.Aop.RuntimeWeavedJoinpoint.Proceed()
   at InsERT.Mox.DataExtensions.DisabledPropertiesValidationAspect.Execute(IJoinpoint joinpoint)
   at InsERT.Mox.Aop.RuntimeWeavedJoinpoint.Proceed()
   at InsERT.Mox.DataExtensions.ObsoleteExtensionNotificationAspect.Execute(IJoinpoint joinpoint)
   at InsERT.Mox.Aop.RuntimeWeavedJoinpoint.Proceed()
   at InsERT.Mox.Aop.Weaver.RuntimeWeave(RuntimeWeavedJoinpoint joinpoint, Action coreOperation)
   at InsERT.Mox.BusinessObjects.BusinessObject`3.AfterRelatedEntitySetPrivate(Object entity, RelationshipChangedEventArgs args)
   at InsERT.Mox.BusinessObjects.BusinessObject`3.InsERT.Mox.DataAccess.IDataEventsSink.OnRelationshipChanged(Object affectedDataObject, RelationshipChangedEventArgs args)
   at InsERT.Mox.DataAccess.EntityFramework.EntityDataObjectBase.CallRelationshipChangedOnSponsorWithCorrectLazyLoadingSetting(IDataEventsSink sponsor, RelationshipChangedEventArgs args)
   at InsERT.Mox.DataAccess.EntityFramework.EntityDataObjectBase.HandleImplicitAssociationChange[T](EntityReference`1 reference, CollectionChangeEventArgs args, String referencePropertyName)
   at InsERT.Moria.ModelDanych.BazowyZapisWEwidencjiVAT.HandlePodmiotRelatedEndAssociationChanged(Object sender, CollectionChangeEventArgs e)
   at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.OnAssociationChanged(CollectionChangeAction collectionChangeAction, Object entity)
   at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.Add(IEntityWrapper wrappedTarget, Boolean applyConstraints, Boolean addRelationshipAsUnchanged, Boolean relationshipAlreadyExists, Boolean allowModifyingOtherEndOfRelationship, Boolean forceForeignKeyChanges)
   at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.Add(IEntityWrapper wrappedEntity, Boolean applyConstraints)
   at System.Data.Entity.Core.Objects.DataClasses.EntityReference`1.set_ReferenceValue(IEntityWrapper value)
   at System.Data.Entity.Core.Objects.DataClasses.EntityReference`1.set_Value(TEntity value)
   at InsERT.Mox.DataAccess.EntityFramework.EntityDataObjectBase.HandleExplicitAssociationSetPrivate[T](EntityReference`1 reference, T relatedEntity, String referencePropertyName)
   at InsERT.Mox.DataAccess.EntityFramework.EntityDataObjectBase.HandleExplicitAssociationChange[T](EntityReference`1 reference, T relatedEntity, String referencePropertyName)
   at InsERT.Moria.ModelDanych.BazowyZapisWEwidencjiVAT.set_Podmiot(PodmiotHistoria value)
   at InsERT.Moria.EwidencjaVAT.ZapisWEwidencjiVATBO.UstawPodmiotInternal(PodmiotHistoria podmiotAktualny, AdresHistoria adresPodstawowyAktualny)
   at InsERT.Moria.EwidencjaVAT.ZapisWEwidencjiVATBO.UstawPodmiot(Podmiot podmiot)
   at InsertSDK.SDKHelpers.VatRegisterHelper.Save(IDocument document) in C:\Work\Nexo\NexoDocumentsTransfer\InsertSDK\SDKHelpers\VatRegisterHelper.cs:line 83
   at InsertSDK.SDKHelpers.SDKHelper.SaveDocuments(List`1 documents) in C:\Work\Nexo\NexoDocumentsTransfer\InsertSDK\SDKHelpers\SDKHelper.cs:line 38
   at DocumentsTransferProvider.NexoDataProvider.SaveToNexo(List`1 documents) in C:\Work\Nexo\NexoDocumentsTransfer\DocumentsTransferProvider\NexoDataProvider\NexoDataProvider.cs:line 26
   at DocumentsTransferProvider.TransferProvider.RunTransferThread() in C:\Work\Nexo\NexoDocumentsTransfer\DocumentsTransferProvider\TransferProvider.cs:line 52
   at DocumentsTransferProvider.TransferProvider.StartTransfer(Int32 seconds) in C:\Work\Nexo\NexoDocumentsTransfer\DocumentsTransferProvider\TransferProvider.cs:line 22
   at NexoDocumentsTransfer.MainWindow.Button_Click(Object sender, RoutedEventArgs e) in C:\Work\Nexo\NexoDocumentsTransfer\NexoDocumentsTransfer\MainWindow.xaml.cs:line 61
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at NexoDocumentsTransfer.App.Main()

  This exception was originally thrown at this call stack:

Inner Exception 1:
TargetInvocationException: Obiekt docelowy wywołania zgłosił wyjątek.

Inner Exception 2:
ConstraintException: The 'KorzystajZParametrowAutomatycznejDekretacji' property on 'Podmiot' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Boolean'. 
 

Link to postu

Dziękuję za odpowiedź.

 

Spróbowałem powtórzyć problem (opis dalej), ale u mnie się nie powtarza.

 

Z opisu i ze stacktrace wynika jakby zapytanie o dane klienta wykonywało się z pominięciem pobrania wartości z kolumny KorzystajZParametrowAutomatycznejDekretacji. Wskazuje to na jakąś zaszłość w katalogu z QueryCache lub jakiś pokrewny problem.

 

Proponuję - w oparciu o mój sposób reprodukcji problemu z minimum zależności - spróbować wyizolować problem.

 

Oto jak spróbowałem powtórzyć problem:

 

1) Założyłem bazę danych demo Rachmistrza 45.1.1

2) Podniosłem ją do Rachmistrza 47.0.1

3) W LinqPad 5 napisałem i uruchomiłem następujący program opierający się o Sferę, który wykonał się bez wyjątków:

image.thumb.png.93e7d69868a96b0ca6c75869654ccb13.png

 

Celem wyizolowania problemu proponuję ściągnąć LinqPad 5 (jest darmowy - https://www.linqpad.net/Download.aspx), otworzyć w nim załączony plik *.linq - zapis_vat.linq, zmodyfikować referencje do plików z NexoSDK (F4 w LinqPad 5), zmodyfikować kod wskazujący na bazę danych i spróbować powtórzyć problem na bazie na której problem występuje i na jakiejś innej, np. na bazie demo.

Link to postu
×
×
  • Dodaj nową pozycję...