Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronization of session variables

 
Kambhammettu Eswar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no synchronization provided by container for the session object. If multiple threads attempt to access an object stored in the session and modify the value, it’s up to the developer to provide synchronization. There is no automatic synchronization provided by the session. Is there any known standard mechanism to do it?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is any other way than using synchornized methods or blocks.
 
G Subrahmanyam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One can use java.io.serializable for the same
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What has serializablegot to do with synchronization???

Originally posted by subrahmanyam gampa:
One can use java.io.serializable for the same
 
Kambhammettu Eswar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also do not understand what java.io.serializable has to do with synchronization of session variables.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eswar
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at JavaRanch's naming policy. . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please change to a new name which meets the requirements.
Thanks.
 
Mani Balasubramanian
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interstingly I too have this session problem. I have a HTML frame contains 2 JSPs. When I access session values from both the pages, its throwing LockTimedOutException.
I think it has something to do with session synchronization.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!