Preserve iDempiere session between sucessive webservice calls


We talked at Bischofstein workshop about the ability to preserve the iDempiere session between sucessive webservice calls.

This can help to improve the speed - and also for traceabilty as you can see in Session Audit all what the webservices do within one session record instead of thousands.


Carlos Ruiz




Pritesh Shah
May 15, 2018, 12:56 PM

Perfect! code changes seems to be good.

I am sorry I didn't get much time to prepare the SOAP test request and scenario which can reproduce the issue.

Anyways, its good that the issue is resolved

Pritesh Shah
May 16, 2018, 3:20 PM

I found one issue which definitely i would not be able to send you any SOAP request or test data. In order to reproduce the issue, you might to do the following,

  1. Create one web service with run process

  2. Implement the code in run process which uses ctx variables like Env.getAD_Client_ID(Env.getCtx())

  3. Call webservice from postman and with Stage as 1 (1 Minute i believe)

  4. Call webservice again before 1 min ends which means second request would be served from cache (login perspective)

  5. Call webservice after a delay of 2 mins where session would have expired

  6. In the last call of webservice after session is expired, login will be done and if you log value of Env.getAD_Client_ID(Env.getCtx()) in your process it would be 0 instead of actual client passed in webservice request.

We need to comment below code from all webservice methods like createData, queryData etc

All below code to method

I have attached the patch for understanding

Pritesh Shah
May 16, 2018, 3:21 PM

Sorry I cant attach patch as story is closed

Carlos Ruiz
May 16, 2018, 3:33 PM

, please open a new ticket related to this to report new incidences.

Carlos Ruiz
July 9, 2018, 12:44 PM

Hi , I made a new commit that must solve what you reported above.


Carlos Ruiz


Carlos Ruiz


Carlos Ruiz


Tested By