2019-11-28 21:59:00 UTC
I'm using the httpServer and have a set of reference data that sits in a database (which is also the system store). For performance (and coding convenience!) reasons I'd like to avoid having to re-read this from the db each time I get a new http request.
The problem I'm hitting is that on each request the httpServer clones itself and then executes. That means all the cached data in the 'main' thread isn't available in the clone as it starts afresh.
I've tried task.setConfiguration("parm", object), but that's null on 'getConfiguration()' - fairly obvious I guess because each clone is it's own task.
I had hoped to get hold of the AL config and put my objects in that, but either I can't find the AL config, or what I am using isn't part of the clone.
I'm thinking towards serialising the objects and putting them in the java property store, but I'm not sure how that will perform & still will incur a load of marshalling/unmarshalling.
Does anyone have a suggestion about how to get an object (HashMap) into the AL such that it (or it's reference) can be included in the clone?