Wrong Result return RunOnClient = No

yukon
Member Posts: 361
Hi,
According to MSDN we can define the dot net interpo is running at Client or Server side. But some of the case it working on Server Side but return result is taking from client information. I don't know what is the reason of this. Does anybody face this issue?
Regards,
According to MSDN we can define the dot net interpo is running at Client or Server side. But some of the case it working on Server Side but return result is taking from client information. I don't know what is the reason of this. Does anybody face this issue?
Regards,
Make Simple & Easy
0
Answers
-
I used this property multiple ti,es but never faced this. Can you explain it more with the codes?Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
It might be due to lack of user process isolation.
You don't know what is inside the particular .NET t interop - it might be using some shared memory, it might have static members. If it is the case you may two users having their own instances of .NET vars, but since they both run on the same NST process the internall .NET code might be manipulating internally the same aera of memory, so the data is leaking between users' processes.
Not sure, just guessing.
Long time ago when the RTC came to life and people were using in their code single instance codeunits they moaned that if they use the same code from a web service call the data inside single instance codeunit is not preserved between calls (which was just a lack of understanding that each web service call is a separate session). Someone came up with a trick exploiting static class members to build a .NET dll enabling to preserve the status/data between web calls - effectively sharing the data between sessions.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
@Slawek_Guzek and @RockWithNAV
Thanks for your reply and interesting on my question.
Actually, i'm using single user to testing this case. Below is my test case
OBJECT Codeunit 50000 DNetTest
{
OBJECT-PROPERTIES
{
Date=12/04/18;
Time=[ 8:32:09 PM];
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnRun=VAR
dnetSysRunOnClient@1000000000 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Principal.WindowsIdentity" RUNONCLIENT;
dnetSysRunOnServer@1000000001 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Principal.WindowsIdentity";
dnetCultureInfoRunOnClient@1000000002 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Globalization.CultureInfo" RUNONCLIENT;
dnetCultureInfoRunOnServer@1000000003 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Globalization.CultureInfo";
BEGIN
MESSAGE('Client User %1\Server User %2',
dnetSysRunOnClient.GetCurrent.Name,dnetSysRunOnServer.GetCurrent.Name);
dnetCultureInfoRunOnClient := dnetCultureInfoRunOnClient.CurrentCulture;
dnetCultureInfoRunOnServer := dnetCultureInfoRunOnServer.CurrentCulture;
MESSAGE('Client Culture %1\Server Culture %2',
dnetCultureInfoRunOnClient.Name,dnetCultureInfoRunOnServer.Name);
END;
}
CODE
{
BEGIN
END.
}
}
You will get right result for Login user name but Culture result is wrong. Why wrong? Culture name is always same, even you set different region setting on server and client. By right should be different name if we set different region setting on Server and Client. "dnetCultureInfoRunOnServer" is running on server but name is taken from "Client Region Name".
In order to test you need to set different Region Setting on Server and Client.
I was posted on https://community.dynamics.com/nav/f/34/t/276917. One of active member reply that can be Threading. I not sure how Nav server handle the threading in between server and client.
Regards,Make Simple & Easy0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions