Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-10 Thread Anton Mityagin
Yeah, i see. You implement manual version control in your project. But, I decided to use RF in my project to forget about transmission domain objects between server and client. In general, it is unclear why the guys at Google have made the RF this way. On Wednesday, June 10, 2015 at 2:51:48

Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-10 Thread Thomas Broyer
On Wednesday, June 10, 2015 at 12:21:03 PM UTC+2, Anton Mityagin wrote: In general, it is unclear why the guys at Google have made the RF this way. If you look at the changes between the various milestones and RCs of GWT 2.1, and then 2.1.1 and 2.2, you'll see that RF is totally different

Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-10 Thread Anton Mityagin
Undoubtedly, RF - greate thing. I use it and plan to continue to use. The more that I get to make workaround for those things that do not exist in RF. Just very strange that such a good thing as RF does not support such basic things like optimistic locking, refire request after excpetion.

Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-09 Thread Ignacio Baca Moreno-Torres
We made a similar approach using the client/server version variables. But we call it version/expectedVersion. class MyEntity { @Version int version; public int getExpectedVersion() { return null; } public void setExpectedVersion(int v) { this.version = v; } public int getVersion() { return

Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-09 Thread Anton Mityagin
Thanks for your comment On Tuesday, June 9, 2015 at 10:12:10 PM UTC+3, Ignacio Baca Moreno-Torres wrote: We made a similar approach using the client/server version variables. But we call it version/expectedVersion. As explained in stackoverflow

Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-09 Thread Jens
We don't use RequestFactory but GWT-RPC with Eclipselink + optimistic locking and heavy auto saving. Because we don't want to live with the extra query when doing the em.find / detach / update version / merge dance we simply do the version check manually in the app. Also we don't send versions

Re: GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-09 Thread Ignacio Baca Moreno-Torres
IMO using attached entities in RF is dangerous because in hibernate any committed transaction will persist any previous change in the current context. So, if you are using per-request entityManager, whenever you call transaction.commit you will persist any modification sent from the client

GWT 2.7.0 RequestFactory + Spring + JPA + Hibernate optimistic locking implementation

2015-06-08 Thread Anton Mityagin
As all you know RequestFactory does not support optimistic locking. see details https://code.google.com/p/google-web-toolkit/issues/detail?id=6046 I tried to implement it для RequestFactory + Spring + JPA + Hibernate I took as a basis the idea proposed by Thomas