Dynamics AX 2012 Formdatasource::executeQuery 在特定远程服务器上调用更多方法

问题描述 投票:0回答:2

所有 AX 客户端均通过 RDS 访问。

几周前我们收到一张票,指出某个应用程序性能不佳。我们正在调查它,但无法重现该问题。经过一些测试,问题似乎只发生在 2 个特定的远程桌面上,其他远程桌面上没有。

然后我们开始使用 Tracing cockpit 跟踪两台服务器上的应用程序,我注意到在慢速服务器上,executeQuery 调用了更多与快速服务器相同的方法,特别是 SysQueryRun::next 和 QueryBuildDataSource::findRange

因此,我决定设置一个非常简单的测试表单,其基本逻辑与有问题的应用程序相同,这似乎是可重现的,尽管调用次数比实际应用程序少很多。

表单上使用的逻辑非常简单。在 header-formdatasource 的活动中,我们调用detail-formdatasourceexecuteQuery 并将过滤器应用于detail-table。

在快速服务器上:

Trace-faster-server

在慢速服务器上:

Trace-slower-server

发生这种情况的原因可能是什么?确实有影响。

我尝试了以下方法:

  • Google 搜索了很多,但没有相关的搜索结果,但可能是搜索关键字非常通用

  • 重启AOS、远程桌面服务器

  • CIL-编译

  • 重新创建表单以隔离问题,问题仍然存在

microsoft-dynamics x++ dynamics-ax-2012
2个回答
0
投票

我见过当 AUC/KTI 缓存文件损坏时会发生类似的问题。每次打开新客户端时,它们都可以安全地删除并重建。

我编写了一个小 PowerShell 脚本,您可以在受影响的服务器上运行它,它会为您删除文件。它还会执行“模拟”删除,以便您可以提前查看将删除的内容。

您需要确保用户未登录服务器上的 AX,否则删除某些文件将失败,因为它们将被锁定。如果发生这种情况,没什么大不了的...只需将用户踢出 AX 并重新运行脚本,直到所有内容都被正确删除即可。

Write-Host "For the server $($env:COMPUTERNAME), this script will delete AX user application specific cache files. This is different than 'Usage Data' which will not be affected." -ForegroundColor Green
Write-Host "Specifically it removes *.AUC/*.KTI files from each user's %LOCALAPPDATA% directory and the files located in '%LOCALAPPDATA%\Microsoft\Dynamics Ax' for each user." -ForegroundColor Green
Write-Host "It will also save a transcript to the desktop." -ForegroundColor Green
while(-not (($choice= (Read-Host "Do you want to continue? (No will simulate, but not delete) [Y/N]")) -match "^[YNyn]{1}$")){ "Y or N ?"}
$DoDelete = ($true, $false)[!($choice -eq 'Y')]

Start-Transcript -Path (Join-Path ([Environment]::GetFolderPath("Desktop")) "UserCacheDelTranscript.log") -Append

if (!$DoDelete)
{
    Write-Host "Simulating delete..."
}

Get-ChildItem -Path "C:\Users" -Directory | ForEach-Object {
    $DelPath = "$($_.FullName)\AppData\Local\*"

    if (Test-Path $DelPath) {
        # Remove *.auc/*.kti files
        Get-ChildItem -Include *.auc, *.kti -Path $DelPath | ForEach-Object {
            Write-Output ("Deleting '{0}'" -f $_.FullName)
            if ($DoDelete) {
                Remove-Item $_
            }
        }
    }

    # Remove other misc cache files
    $DelPath = "$($_.FullName)\AppData\Local\Microsoft\Dynamics Ax"
    if (Test-Path $DelPath) {
        Get-ChildItem -Path $DelPath | % {
            Write-Output ("Deleting '{0}'" -f $_.FullName)

            if ($DoDelete) {
                Remove-Item -Path $_.FullName -Recurse -Confirm:$false
            }
        }
    }
}

Stop-Transcript

0
投票

转到

Help>About
,检查所有服务器和客户端是否具有相同的内核版本。

或者,您可以检查用户日志(\Menus\SystemAdministration\Inquiries\Users\User log),并在常规选项卡上显示登录的不同版本号。我通常会个性化该表单并将其移动到网格中。这样我就可以向上/向下滚动并查找客户端不匹配的情况。

© www.soinside.com 2019 - 2024. All rights reserved.