life is all about options, and the development of business applications is no different. fewer options amount to less flexibility; however, limiting your choices certainly simplifies the decision process. on the other hand, more options means more flexibility for your application, albeit at the cost of lengthy debate over which choice is best for you. this months topic discusses the choices available when you implement persistence with entity beans in your enterprise javabeans application.
entity bean state management 【推荐阅读:Managing Environment】
as i sit down to write this article, the hype for star wars episode 1: the phantom menace is even greater than the java industry hype before the release of the enterprise javabeans specification 1.0! i couldnt help including a few references of my own to the beloved trilogy in hopes of adding a little flavor to an otherwise drab topic: persisting data.enterprise javabeans persistence: two persistence models
the enterprise javabeans 1.0 (and newly released 1.1) specification attempts to simplify decisions about persistence by providing a straightforward persistence model for managing the state of entity beans (note that entity bean support is not mandatory in 1.0 of the ejb specification, but is mandatory for ejb 1.1 compliance). state management refers to the creation, destruction, loading and storage of persistent data in an entity bean. the ejb specification defines a small set of methods to perform these important services: ejbcreate, ejbload, ejbstore, ejbremove, ejbactivate and ejbpassivate. were particularly interested in the first four, which represent the crud (create, read, update and delete) operations typically seen in a persistent application. over the course of this article youll become intimate with these methods and their state management responsibilities through the intergalactic travel ticket system examples.
besides describing the methods for managing an entity beans state, the ejb specification offers two models of per... 下一页