IAgileSession close

Do we need to always close an IAgileSession during a Groovy Script?

For example, is this necessary to add the ‘session.close()’ method to the following script to help prevent memory leak issues?

import com.agile.agileDSL.ScriptObj.IBaseScriptObj
// add other import statements here
void invokeScript(IBaseScriptObj obj) {
IAgileSession session = obj.getAgileSession()

//do something
obj.logMonitor(“did something”)
session.close()
}

No Files Were Attached
Matt Paulhus Agile Expert Asked on December 13, 2017 in Other APIs.
Add Comment
1 Answer(s)
Best answer

No. You do not need to close the session with these types of PXs. Agile is taking care of the session. Only if your PX creates a connection (SessionFactory) do you close the session when you are done.

Steve Jones, the PLM Doctor Agile Angel Answered on December 13, 2017.

Only time you create a session is when your PX is stand-alone (i.e. not known by Agile).

on December 13, 2017.

Do you know if that’s also true for the getFactory() type connections within a groovy script (database queries)?

connection = ConnectionFactory.getFactory().getConnection();
connection.close()

on December 13, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.