-
1. Re: Problem with CMP
peterj Jun 3, 2009 11:26 AM (in response to vink)Don't you mean @Stateless, and not @SLSB?
I assume that you are using EJB3 and JPA. You need to use the entity manager to save the entity, otherwise the database will not get updated. -
2. Re: Problem with CMP
vink Jun 4, 2009 12:15 AM (in response to vink)I mean @Stateless. (Dummy code for understanding only)
I think! when you are working on an existing entity & you modify that entity. After your parent transaction is over, we expect your entity manager will be flushed automatically & your entity will be updated in the database.
In my case entity manager is injected in every ComponentBean. -
3. Re: Problem with CMP
justkeys Jun 4, 2009 4:42 AM (in response to vink)I think it all depends on the transaction attributes.
You have to make sure that the fetching and modification of the entity happen within the same transaction, by annotating the outer ejb with@TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
-
4. Re: Problem with CMP
vink Jun 4, 2009 4:51 AM (in response to vink)Hello Dieter,
I think, we don't need to specify this attribute explicitly; it is by default.