Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Howt to have Extended persistence context for @Stateless EJBs and POJOS

Hi!
I while ago I posted here asking for a way to emulate FlushMode.MANUAL in
EclipseLink for support
of conversational behavior, and back then I 
http://dev.eclipse.org/newslists/news.eclipse.rt.eclipselink/msg00060.html
was told  that:


Doug Clarke wrote:
> 
> Making changes within a entity manager acting as an extended persistence
> context where the complete set of conversation changes are committed in a
> single transaction does make sense and is very common. JPA supports this
> through its support for joining of an extended persistence context with a
> transaction. 
> 

So I went and asked about that in on the 
http://www.seamframework.org/Community/InjectionIntoEntityBeans#comment79802
Hibernate side ... And got 
http://www.seamframework.org/Community/InjectionIntoEntityBeans#comment79824
this answer  stating, basically that extended persistence contexts get
broken because:


Gavin King wrote:
> 
> [...]if I call a stateless session bean, the persistence context does not
> propagate, so any work it does is either committed non-atomically (i.e.
> immediately) or not at all. Work done by stateless session beans is not
> able to form part of the atomic long-running optimistic "transaction".
> 

Now... am not sure I really understand this... but my interpretation is that
plain JPA only supports extended persistence contexts  in @Stateful EJBs,
and if I try use an extended persistence context in @Stateless EJBs (or in
plain POJOs working in a "Stateful-like" way thanks to not-standard the
services provided by Spring or Seam) it will break and fail. 

Did I understood correctly? And if I did : is there an EclipseLink specific
extension to provide something like an extended persistence context  for
POJOS (and/or  @Stateless EJBs)?

Regards,

-- 
View this message in context: http://www.nabble.com/Howt-to-have-Extended-persistence-context-for-%40Stateless-EJBs-and-POJOS-tp23870645p23870645.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top