-
1. Re: Prevent EntityManager persisting
dornus Jan 12, 2006 1:08 PM (in response to dornus)In the mean time, I made a transient variable in the MyTable class called displayName.
Hopefully there is a better solution? -
2. Re: Prevent EntityManager persisting
ejb3workshop Jan 12, 2006 6:57 PM (in response to dornus)You are breaking MVC in a bad way. You seem to doing presentation logic inside a session bean. session beans are about business logic. Rather add the additional field on the client side rather then within the session bean itself.
The reason the database is updated is that you are still working within the entity / persistent context as you are still inside the container. If you had to use a remote client (are you using remote or local interfaces ?) then perform the presentation logic in the client code. -
3. Re: Prevent EntityManager persisting
gavin.king Jan 12, 2006 7:04 PM (in response to dornus)I think what he's doing is fine.
The idea that session beans are never used in the presentation tier is oldstyle EJB2 thinking.
To stop a method from persisting changes, mark it @TransactionAttribute(NOT_SUPPORTED). -
4. Re: Prevent EntityManager persisting
dornus Jan 19, 2006 9:51 AM (in response to dornus)Excellent, thank you.
FYI, slight change but it should be@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)