Affordable web design - CHAPTER 9 Working with objects Figure 9.2 Conversation
CHAPTER 9 Working with objects Figure 9.2 Conversation implementation with detached object state The detached object state and the already mentioned features of reattachment or merging are ways to implement a conversation. Objects are held in detached state during user think-time, and any modification of these objects is made persistent manually through reattachment or merging. This strategy is also called session-perrequest- with-detached-objects. You can see a graphical illustration of this conversation pattern in figure 9.2. A persistence context only spans the processing of a particular request, and the application manually reattaches and merges (and sometimes detaches) entity instances during the conversation. The alternative approach doesn t require manual reattachment or merging: With the session-per-conversation pattern, you extend a persistence context to span the whole unit of work (see figure 9.3). First we have a closer look at detached objects and the problem of identity you ll face when you implement a conversation with this strategy. Figure 9.3 Conversation implementation with an extended persistence context
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.