[Symptom]
In BaseModule, WebPlatform, and AppFramework, Client.set, Client.get behavior differs depending on the following conditions.
· When the persistence and restoration of HttpSession is performed depending on the type and settings of the AP server
· Sticky session is not set in the setting of the load balancer in a distributed environment
These conditions cause Client API to behave differently.
Here are examples:
----
Example 1:
If properties of the value passed to Client.set is changed after Client.set
var key = 'key'
var value = {
foo: 'FOO'
};
Client.set(key, value);
//Change a property of the value after calling Client.set
value.foo = 'foo'
Client.get(key);// (1)
----
In this case, the value acquired at the timing of (1) might vary depending on the type and configuration of the AP server.
There is no guarantee that the value acquired in (1) is the same instance as the value passed in at Client.set. Therefore, the value of the foo property of the object acquired by (1) can be 'FOO' or 'foo'.
When Client.set is called, it is recommended that the value passed in at that time be treated as an unchanging object and write the process without changing the property.
----
Example 2:
After Client.get, if properties of the value acquired in Client.get is changed
var key = 'key'
var value = {
foo: 'FOO'
};
Client.set(key, value);
var value2 = Client.get(key); // (1)
value2.foo = 'foo'
Client.get(key); // (2)
----
Same as in example 1, there is no guarantee that the value acquired in (1) is the same instance as the value passed in at Client.set. Therefore, the value of the foo property of the object acquired by (2) might be 'FOO' or 'foo'. When Client.get is called, it is recommended that the value acquired at that time be treated as an unchanging object after that, and write the processing that does not change the property, etc.
In contrast to the above example, intra-mart Accel Platform behaves differently with Client.get and Client.set.
In intra-mart Accel Platform, the value acquired by Client.get is a different instance from the value set at Client.set. Therefore, changing the properties of the values acquired after Client.get does not affect the original values stored in Client API. Also, Client.set does not affect the value stored in Client API if properties of the passed value after Client.set is changed.
[Target versions]
BaseModule Ver.4.0.x to Ver.5.1.x
WebPlatform Ver.6.0.x to Ver.7.2.x
AppFramework Ver.6.0.x to Ver.7.2.x
From intra-mart Accel Platform 2012 Autumn (Alba)
*The following API is available from "2013 Autumn".
Separately from the Client object, the Client72 object that operates with specifications from Web Platform ver4.0 to ver7.2 is provided.
API list (http://www.intra-mart.jp/apilist/iap/apilist-ssjs-compatible/doc/compatible/Client72/index.html)
Related requirements: requirement [3867] behavior compatibility correspondence of the Client objects is performed.
https://issue.intra-mart.jp/issues/3867 (Japanese)
-- Target ------------------------------------------------------------------------
iAP/Accel Platform/All Updates
-----------------------------------------------------------------------------------
FAQID:11