• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

application managed persistence context

 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
In every book I have read it have been written that application managed persistence context can be performed only in Stateful session beans. Is that correct?
I mean, you cannot span entity manager through multiple method of Stateless bean, or you can???
Well I thought that you can,. but I found this in ejb3_persistent_spec.

Considering this statement it mean that Stateless beans cannot be used, because they cannot be used in extended scope, right???
and then I found this piece of code, I believed that it could exists only in Stateful bean


Please, does anyone could clarified my doubts about this issue?
thanks
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You can use an application-managed Entity Manager to gain more control over the transactions or the EM lifecycle.The container do the work transparently but this doesn't mean you can not interfere in it.

What it is doing the code you posted is basically the same it occurs at the background using a container-managed EM.
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic