Hello! I'm programmer and currently i'm working with JSF2, Tomcat and I am trying use the Seam 3 Persistence Module
I'd like to know if someone already worked with this seam module, because i have some questions.
I have already worked with EJB and JSF1.2, It was very easy to execute CRUD operations without invoke the methods: entityManager.begin() and entityManager.commit() (automatic transaction handling from the EJB container).
How can I make Seam work this way too? I've done some tests but sometimes it works, sometimes doesn't.
I Have my EntityManagerPrducer:
@Produces
@ExtensionManaged
@ConversationScoped
@PersistenceUnit(unitName = "meuPu")
EntityManagerFactory em;
My backingBean is anoted with @Named and @ViewScoped, he injects a service class responsible by CRUD operations (The service class injects the entityManager).
If i'm using @ViewScoped in my backingBean, what's the correct scope for EntityManagerProducer?
did you try removing the scope all together? I don't think you need @ConversationScoped there.