I've set up my DAO objects to use @PersistenceContext in stead of @In so I have better control on when transactions are commited.
If i'm correct then there is a
globaltransaction by seam. This allows for easy lazyLoading of properties. If I get entities using a entityManager via @PersistenceContext then I get the following exception:
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
I guess this is because my statefull session bean receiving the entities has an other instance of a persistenceContext en so can nog lazy load dataproperties from my entities.
Is there a good way to use Container managed transactions together with Seam managed transactions? Or is there a way to commit a transaction using the seam transaction management?