• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Extended persistence context

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(this question has been posted once before, but I'd really like the authors to answer it, to verify that my assumptions are correct)

Hi,

I have a question about extended persistence context on a SFSB.
If I have a SFSB that's only purpose is to store session(instance) variables. All data retrieval and persistence is done by calling SLSB.

Example:



As you can see, the SFSB doesn't use the entityManager, but as the Extended persistence context can only be set on a SFSB (and rightly so) I have to include the entitymanager in the SFSB to get the extended persistence context propogated to the SLSB.

Is this correct? Or is there another way to get the extended persistence context propogated to the slsb, without having do declare a entitymanager in my sfsb that is never used? (The reason I wan't to use an extended Persistence Context is that I don't want the JPA Entities stored as instance variables in the SFSB to be detached).
 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your code is semantically correct. However, the true power of extended persistence contexts will be apparent if you use the entity manager directly in the Controller bean instead of using a facade. The entity manager in CustomerServiceBean will not have an extended persistence context.
[ March 13, 2007: Message edited by: Reza Rahman ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic