com.sun.ejb.spi.container
Interface BeanStateSynchronization


public interface BeanStateSynchronization

There are cases where the container would need to interact with the persistence manager. Some known cases are listed below 1. provide the user with a mechanism to flush changes to the database at the end of a method with out waiting until the end of the transaction. 2. for read only beans provide a mechanism to have the master copy of the bean sync up with the database record. Currently the bean concrete implementation that is created as part of the codegen would implement this interface.

Author:
Pramod Gopinath

Method Summary
 void ejb__flush()
          Provides a mechanism to flush changes to the database w/o waiting for the end of the transaction, based on some descriptor values set by the user.
 void ejb__refresh(java.lang.Object primaryKey)
          On receiving this message the PM would update its master copy by fetching the latest information for the primary key from the database
 void ejb__remove(java.lang.Object primaryKey)
          On receiving this message the PM would delete from its master copy the details related to the primaryKey
 

Method Detail

ejb__flush

void ejb__flush()
                throws DuplicateKeyException
Provides a mechanism to flush changes to the database w/o waiting for the end of the transaction, based on some descriptor values set by the user. The container would call this method in the postInvoke(), only if the flush is enabled for the current method and there were no other exceptions set into inv.exception.

Throws:
DuplicateKeyException

ejb__refresh

void ejb__refresh(java.lang.Object primaryKey)
On receiving this message the PM would update its master copy by fetching the latest information for the primary key from the database


ejb__remove

void ejb__remove(java.lang.Object primaryKey)
On receiving this message the PM would delete from its master copy the details related to the primaryKey



Copyright © 2012 GlassFish Community. All Rights Reserved.