baiheqiang / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Null on non-sticky transient object. #220

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use some transient fields in JSF view scope bean.
2. Call another bean method using pram with that object from JSF.
3. The object instant is null as parameter.

What is the expected output? What do you see instead?
sticky is working fine so I am thinking non-sticky will also work but getting 
null object.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by shahinur...@gmail.com on 23 Nov 2014 at 7:29

GoogleCodeExporter commented 8 years ago
I don't fully understand the issue (too little information), but I'd say that 
it's expected that transient fields are not initialized after deserialization. 
If you want that field to be (de)serialized then make it not transient. 

Original comment by martin.grotzke on 23 Nov 2014 at 10:45

GoogleCodeExporter commented 8 years ago
Thanks for your response!

The scenario is, 
I have some transient properties in my controller which are bind with JSF page 
. My target is reduce CPU and IO usages. 
The things are working fine on following cases
1. If I don't configure "memcached-session-manager" with that application.
2. If I configure "memcached-session-manager" with sticky="true"

But when I am changing configurations from sticky="true" to sticky="false" then 
I am getting all of the transient variable / properties null in reference 
functions which is calling from JSF page. 

Could you please advise me in details, I am expecting similar behavior for 
sticky and non-sticky about transient variable.  

Original comment by shahinur...@gmail.com on 23 Nov 2014 at 11:06

GoogleCodeExporter commented 8 years ago
On deserialization you need to initialize your transient variables. So it 
depends on the serialization strategy how to achieve this.

Original comment by martin.grotzke on 23 Nov 2014 at 11:47

GoogleCodeExporter commented 8 years ago
for your information I am initialize all of the transient variable in 
@PostConstruct otherwise sticky session was not work perfectly.

Original comment by shahinur...@gmail.com on 23 Nov 2014 at 5:55

GoogleCodeExporter commented 8 years ago
As already said, you want to initialize your transient fields on 
deserialization. Assuming that you're using java serialization read the docs: 
https://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html

Original comment by martin.grotzke on 23 Nov 2014 at 7:21