How to create a new Session in E11?

I need to create a new session object within a data directive because it keeps saying the login has disconnected. How would I do something like this in a Data Directive/BPM in E11…

Session session1 = (Session)this.oTrans.Session;
string url = session1.AppServer;
Ice.Core.Session session2 = new Ice.Core.Session(“username”, “password”,url );

I recall this has changed to something like this:

var ehsSession = (Epicor.Hosting.Session) Session;

Looking for some assitance. TIA.

Are you doing this in tran? How long is it taking? I have post processing routines that take a long time to complete. I just tested one in 2023.2.8 that ran for almost 2 minutes in the background.

No, it is a Standard Data Directive. I just do not know the syntax to use in E11. This is On Prem Kinetics v. 2022.2.8 (I believe the latest service pack release). If I try to use the same Session object to reload the DataSet it give me an error message in the Event Viewer that the user session has been disconnected. That is why I need to create a new session.

Yeah, I had to rework a few routines for 23.2.8 this weekend for things no longer allowed.

Did you crank the session idle timeout back up in Application settings? Although the new 15 minutes timeout?? should not stop a routine.

I was able to get what I needed done without creating a new session. I believe it had to do something with the Application Server settings as I had increased this 30 seconds and now I do not get disconnected.

1 Like