|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Howt to have Extended persistence context for @Stateless EJBs and POJOSHi!
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 was told that: So I went and asked about that in on the Hibernate side... And got this answer stating, basically that extended persistence contexts get broken because: 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, |
|
|
Re: Howt to have Extended persistence context for @Stateless EJBs and POJOSNot sure I understand but you seem to want to ignore the container JPA transactions correct?
Normally when using EJB any work you do inside a JTA transaction will be committed when that JTA transaction commits, normally at the end of the SessionBean method, or when the JTA transaction is committed explicitly. You seem to want your EntityManager transaction to span multiple server calls, and multiple JTA transactions. For this I think you would want to use an application managed EntityManager. Either do not use JTA at all, just use EntityManager transactions and commit whenever you desire, or use joinTransaction() when you wish to commit to commit along with the active JTA transaction.
James Sutherland EclipseLink, TopLink Wiki: EclipseLink, TopLink Forums: TopLink, EclipseLink Book: Java Persistence |
|
|
Re: Howt to have Extended persistence context for @Stateless EJBs and POJOSAnd this application managed EntityManager will give this conversational handling of transactions even when used inside @Stateless EJBs? and if it can be used on @Stateless EJBS... Can you offer any insights on why Gavin thinks it can not be used with @Stateless EJBS? (Or am I plain interpreting him wrong?)
|
| Free embeddable forum powered by Nabble | Forum Help |