-
1. Re: Automatic Entity merge
pmuir Sep 25, 2006 9:34 AM (in response to mcloud)It depends whether the entity is detached or managed by the container. As long as the entity is managed then unless you have transactions disabled or automatic flushing turned off then updates will be persisted by the container.
-
2. Re: Automatic Entity merge
gavin.king Sep 25, 2006 3:57 PM (in response to mcloud)Within a conversation, this kind of code is unnecessary, because you can used a conversation-scoped extended persistence context. But if you want to pass an object from one conversation to another, you have to do something like this.
One alternative approach is instead of passing the entity object around, just pass the id in a request parameter and use something like the ManagedEntity component (in Seam CVS) to auto-load the entity instance and expose it via a context variable. I love this approach and the new Seam crud framework will use this heavily. -
3. Re: Automatic Entity merge
cptnkirk Sep 25, 2006 5:25 PM (in response to mcloud)One alternative approach is instead of passing the entity object around, just pass the id in a request parameter and use something like the ManagedEntity component (in Seam CVS) to auto-load the entity instance and expose it via a context variable.
Since request parameters can be easily manipulated by a malicious user, this seems like a pretty dangerous general approach to me. When you're searching a blog or providing REST services, this works great. For a general CRUD framework this worries me.
For example, I wouldn't want my bank's online "add joint account member" conversation to take in currentUserId and newJointUserId as a request params.
Of course, I haven't seen this thing in action, maybe there are safeguards in place to detect manipulation of these params. Please assuage my fears. :) -
4. Re: Automatic Entity merge
gavin.king Sep 25, 2006 6:39 PM (in response to mcloud)I don't mean it for this kind of case.