简体   繁体   English

增加句柄计数的动态 JDE 连接器问题导致 OutOfMemory 并在解决后给出 NullPointerException

[英]Dynamic JDE Connector Issue of Increasing Handles Count leads to OutOfMemory and after resolving it gives NullPointerException

We're trying to use dynamic java connector for JDE9.0 and facing issue of increased Handles count for the process.我们正在尝试为 JDE9.0 使用动态 java 连接器,并面临流程中句柄数量增加的问题。

Scenario:设想:

Calling Dynamic JDE connector in parallel with multiple calls simultaneously.与多个调用同时并行调用动态 JDE 连接器。

The implementation process of executing BSFN is as follows: BSFN的执行过程如下:

1) Login method has all credentials and return sessionID 1) 登录方法拥有所有凭据并返回 sessionID

int sessionID =   
Connector.getInstance().login(username.trim(), password.trim(), env.trim(), role.trim());
…

2) ExecuteBSFN has input parameters as module, bsfnName and inputfile (input data to bsfn) 2) ExecuteBSFN 有输入参数为module、bsfnName 和inputfile(输入数据到bsfn)

…..

ExecutableMethod execMethod = bsfnMethod.createExecutable();
execMethod.resetValues();
Map<String, String> input = inputParams(moduleName, bsfnName, inputFile);

if(input != null)
   execMethod.setValues(input);

CallObjectErrorList errorList = execMethod.executeBSFN(sessionID);
Map output = execMethod.getValues();
….

3) Logout: 3)注销:

Connector.getInstance().logoff(sessionID);    

In this case we observed that Handles count for the process keeps on increasing even though we used logoff() method and eventually leads to OutOfMemory.在这种情况下,我们观察到进程的句柄计数不断增加,即使我们使用了 logoff() 方法并最终导致 OutOfMemory。

In Order to resolve this issue in logout implementation, after doing logoff we called:为了在注销实现中解决此问题,在注销后我们调用:

       Connector.getInstance().shutDown();

In this case we observed that on it throws null pointer exception for subsequent calls.在这种情况下,我们观察到它会为后续调用引发 null 指针异常。 Does anyone know how to overcome this situation?有谁知道如何克服这种情况?

You should review if the BSFN called from the user session prevented the logout by reviewing the enteprise server callobject kernel jde log files as the BSFN is still running asynchronously in enterprise server callobject kernel.您应该通过查看企业服务器调用对象 kernel jde 日志文件来查看从用户 session 调用的 BSFN 是否阻止注销,因为 BSFN 仍在企业服务器调用对象 Z504284C19F1ED39D38 中异步运行

Connector.getInstance().shutDown();连接器.getInstance().shutDown(); will iterate through all the active user session and call Connector.getInstance().logoff(sessionID);.将遍历所有活动用户 session 并调用 Connector.getInstance().logoff(sessionID);。

So if there are other active session running business function, shutDown will logout the session in middle of BSFN execution and will cause null pointer exception for the logged out session. So if there are other active session running business function, shutDown will logout the session in middle of BSFN execution and will cause null pointer exception for the logged out session.

If you have multiple sessions for JDE then Connector.getInstance().shutDown() it not going to work because shutDown() will close all the active sessions that's why you are getting null pointer exception to the other active user.如果您有多个JDE会话,则Connector.getInstance().shutDown()它将无法正常工作,因为shutDown()将关闭所有活动会话,这就是您向其他活动用户获取 null 指针异常的原因。

For your Handles count and OutOfMemory, you can close the particular session like对于您的句柄计数和 OutOfMemory,您可以关闭特定的 session 像

Step 1: logoff the user by session id步骤 1:通过 session id 注销用户

Connector.getInstance().logoff(sessionID);

Step 2: Notify the JDE for shutting down the current session it will solve your handle count and OutOfMemory issue第 2 步:通知 JDE 关闭当前 session 它将解决您的句柄计数和 OutOfMemory 问题

                        NotificationManager.notifyEvent(new JdeEvent() {

                            @Override
                            public Object getSource() {
                                return Connector.getInstance();
                            }

                            @Override
                            public String getName() {
                                return "SHUTDOWN";
                            }
                        });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM