-
1. Re: Seam Managed Persistence Context
christian.bauer Jan 23, 2008 6:31 AM (in response to sebastiendeg.sebastien.degardin.gmail.com)
Sebastien Degardin wrote on Jan 23, 2008 01:01 AM:
The difference is when a Call different Component like SFSB or SLSB during the Conversation, in that case, Seam provide me the right persistence context ? right ? (in that case, the EJB container will provide me different Persistence Context) ?Yes. Although replace
EJB container will
withEJB container might under certain circumstances which are explained in the spec (obscure) and certain books (clear)
. -
2. Re: Seam Managed Persistence Context
sebastiendeg.sebastien.degardin.gmail.com Jan 23, 2008 10:32 AM (in response to sebastiendeg.sebastien.degardin.gmail.com)ok, thanks for that.
I'm going to read about that EJB Container Managed Persistence Context.
Tks
-
3. Re: Seam Managed Persistence Context
asookazian Jul 31, 2009 12:33 AM (in response to sebastiendeg.sebastien.degardin.gmail.com)
Sebastien Degardin wrote on Jan 23, 2008 01:01:
If I have a Conversation Scoped SFSB with a Persistence Context, there is no difference if i Use Extended Container Managed Persistence Context or Seam Conversation Scoped Persistence Context.The above statement is not true.
This:
@PersistenceContext(type=PersistenceContextType.EXTENDED) EntityManager entityManager;
is not the same as this:
@In EntityManager entityManager;
The PC is scoped to the life of the SFSB whereas the SMPC is conversation-scoped:
@Scope(ScopeType.CONVERSATION) @BypassInterceptors @Install(false) public class ManagedPersistenceContext implements Serializable, HttpSessionActivationListener, Mutable, PersistenceContextManager, Synchronization {...}
Also, you cannot use Hibernate manual flush without SMPC (it's not part of JSR220 and thus not usable in @PersistenceContext). So if you only have one SFSB in your use case implementation then maybe it's true they're sort of the same (b/c the same SMPC can be used in multiple components in a LRC but it doesn't apply if there is only one SFSB) but technically ejb-managed PC and SMPC are not the same.