InfoCenter Home >
4: Developing applications >
4.4: Personalizing applications >
4.4.1: Tracking sessions >
4.4.1.1: Session programming model and environment >
4.4.1.1.2: Controlling write operations to persistent store

4.4.1.1.2: Controlling write operations to persistent store

You can manually control when modified session data can be persisted to the datastore by using the sync() method in the interface com.ibm.websphere.servlet.session.IBMSession, which extends the javax.servlet.http.HttpSession interface.

By calling sync() from the service() method of a servlet, you send any changes in the session to the database.

If neither the manual update nor the time-based write option is enabled, the sync() call performs no updates. It merely returns.

Ideally, call sync() after all updates have been made to the session and the session will not be accessed any more. In other words, wait until the end of the servlet service() method to call sync().

Go to previous article: Using URL rewriting to track sessions Go to next article: Securing sessions

 

 
Go to previous article: Using URL rewriting to track sessions Go to next article: Securing sessions