0

We’re trying to use dynamic java connector for JDE9.0 and facing issue of increased Handles count for the process.

Scenario:

Calling Dynamic JDE connector in parallel with multiple calls simultaneously.

The implementation process of executing BSFN is as follows:

1) Login method has all credentials and return 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)

…..

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:

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.

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. Does anyone know how to overcome this situation?

Yogi B
  • 1
  • Hey!!! Did you able to resolve this issue? I am on same boat and facing same kind of issue the "Total number Of Connection" count getting increased. – Hrushi Feb 27 '20 at 17:14

2 Answers2

0

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.

Connector.getInstance().shutDown(); will iterate through all the active user session and call 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.

0

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.

For your Handles count and OutOfMemory, you can close the particular session like

Step 1: logoff the user by 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

                        NotificationManager.notifyEvent(new JdeEvent() {

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

                            @Override
                            public String getName() {
                                return "SHUTDOWN";
                            }
                        });
Ganesh Gudghe
  • 1,327
  • 1
  • 17
  • 41
  • Will NotificationManager not interrupt the SessionClearingThread thread completely, which is started on creating instance of Connector? We are looking for similar fix, which we can do when closing particular session? – Hrushi Mar 02 '20 at 09:12
  • do you have same issue ? – Ganesh Gudghe Mar 02 '20 at 12:00
  • We are facing similar situation, 1) where we want to logoff particular usersession at the end of BSFN call, using Connector.getInstance().logoff(sessionID); 2) where we want to shutdown all sessions when user interrupts graceful shutdown using Connector.getInstance().shutDown(); In above both cases, the no of users and no of connections on JDE server, which were reached to certain number did not decrease which is causing performance slowness I would like to know the correct way to terminate the user session in both the cases, which will reduce the no of users and connections at JDE server? – Hrushi Mar 04 '20 at 07:11
  • @Hrushi if you want to logoff single user then Connector.getInstance().shutDown(); is not going to work because if you look at JDE jar shutDown() method there they have written a logic when the shutdown is called get the all current active session and shut down all those and send notification to JDE server using NotificationManager.notifyEvent(), if you want to logoff single user session then you can use my approach it shutdown on single user session. it will decrease memory issue and improve performance. – Ganesh Gudghe Mar 04 '20 at 08:47
  • @Hrushi if look at the JDE jar they internally calling NotificationManager.notifyEvent() event for shutting down single or multiple user from JDE server. – Ganesh Gudghe Mar 04 '20 at 08:48
  • SessionClearingThread is started on creating instance of Connector which is singleton. Will NotificationManager not interrupt the SessionClearingThread thread completely? Is it safe to call it explicitly after logoff(sessionID) call for each usersession? – Hrushi Mar 04 '20 at 10:14
  • @Hrushi yes, it is safe to call explicitly after logoff(sessionID) call – Ganesh Gudghe Mar 04 '20 at 10:35
  • we had few more queries: 1) Where on JDE Server (JDE 9.2) can we view the sessionID that is returned by Connector.getInstance().login() call? We basically want to verify, that this user is completely terminated by logoff()/shutdown() api at server end. 2) Does shutdown() closes the DB connections and COK users created internally by JDE during any BSFN call? At our server end, the count doesn't seem to change on use of shutdown? – Hrushi Mar 04 '20 at 11:55