Container-managed Compensation for Enterprise Java Beans that use Container-managed Persistence
Original Publication Date: 2004-May-19
Included in the Prior Art Database: 2004-May-19
When an application consists of multiple transactions, changes that are committed in one part of the application cannot be automatically undone if the application fails at a later point. For example, when Enterprise Java Beans (EJBs) that use Container-managed persistence (CMP) are accessed with TxRequiresNew semantics, CMP data updates are made persistent at method end (when the transaction commits). If failures subsequently occur in the application then there is presently no mechanism which will automatically undo those commited data updates. The application has to do what it can to make the application data consistent which is generally a complex and onerous task. This invention provides a mechanism in the middleware which hosts the application to automatically perform such compensation and return the application data to a consistent state.