Serialization and deserialization of the javaweb session && activation and passivation of the session __java

Source: Internet
Author: User
Tags object serialization serialization sessions

Application Scenario:

1. Generally speaking, after the server is started, will not shut down again, but if forced to need to restart, and the user session is still in the corresponding operation, then need to use serialization to save sessions to put on the hard disk, the server restart, and reload. This ensures that the user information is not lost and that the permanent save is implemented

2. Taobao every year there will be regularly snapped activities, many users will be in advance login waiting, long time does not operate, consistent save in memory, and to reach the specified moment, hundreds of thousands of users concurrent access, there may be hundreds of thousands of sessions, memory may be too much, then need to be activated, passivation of the object, Let it leave the memory at idle time, save the information to the hard disk, etc., when it is used, reload into the memory

Serialization and deserialization of a session

What is serialization.

The process of converting an object's state information into a form that can be stored or transmitted, simply by converting an object into a byte-form store is called an object serialization

What is deserialization.

The process of converting a byte sequence into an object

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.