I am thinking more likely the RequestFactory is rendering optimistic
locking useless. The project is created with Roo with DataNucleus  &
GWT. I wiped out all the generated stuff out and use the resulting
Maven build as a starting point. I have been able to get a simple
entity going and have a simple Editor allowing modifications and
retrieval/update via RequestFactory.

In the app I have been able to pile up newly generated Editor with the
same entity, then change the same field one at a time and save it.
Doing so I was hoping the backed JPA stack will give me an exception
complain about update using a stale version. But to my surprise it
isn't doing it. It just happily updated the record and bump up the
version field by one without problem.

Looking at the TCPIP trace, requestFactory's request is indeed only
sending the modified field over the wire. So that means the
RequestFactoryServlet must be quietly loading the current version of
the entity from the db and "merge" the partial-update to construct the
entity object that later passed to the persist method the caller
instructed. Thus, the version would be fine even if the request was
generated based on a staled but modified version of the entity.

So my question to the GWT team, will this be fixed/changed? Or at
least make it a configurable option that requestFactory will
communicate and check the version automatically to ensure the
optimistic locking works?


Thanks,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to