Stateful components collect client session data over successive client method invocations. Normally, state data is stored in memory using fields in the implementation class.
You can manage persistence using these techniques:
Java serialization This model can be used only in EJB stateful session Beans. To save persistent state, EJB Server serializes the component class instance and saves the binary data to the database.
Automatic persistence In this model, you define a state datatype in IDL or Java and implement component methods to receive state data read from the database and return state data to be written to the database. EJB Server calls your state access methods, and manages interaction with the database.