Re: BeanEditForm for hibernate entity with version field

2011-06-14 Thread Geoff Callender
The link http://jumpstart.doublenegative.com.au/jumpstart/examples/easycrud has been replaced by: http://jumpstart.doublenegative.com.au/jumpstart/previews/easycrud/persons On 30/05/2011, at 12:34 AM, Donny Nadolny wrote: > I've got a BeanEditForm for my User entity which has a version

Re: BeanEditForm for hibernate entity with version field

2011-05-30 Thread Geoff Callender
I've just re-tested the JumpStart page and it does what you want. Just be sure to use two different browsers applications for the two users so you're absolutely sure they're not sharing one user session. Are you retrieving the user from the DB in onPrepare()? In debug you would expect to see i

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Taha Tapestry
I am guessing the version field updates are ignored by hibernate so the solution that I suggested is more suitable. Regards Taha Sent from my iPhone On May 29, 2011, at 10:51 PM, Donny Nadolny wrote: > Hi Taha, > > Nice find, that's exactly the problem I have. Unfortunately it didn't seem >

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Donny Nadolny
Hi Taha, Nice find, that's exactly the problem I have. Unfortunately it didn't seem to work. I've tried: tml: java: public void setupRender() { versionWhenLoaded = user.getVersion(); } public void onPrepareEditUserForm() { sessio

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Taha Tapestry
Check this out https://forum.hibernate.org/viewtopic.php?f=1&t=957807 Sent from my iPhone On May 29, 2011, at 10:06 PM, Donny Nadolny wrote: > Hi Taha, > > That would be a reasonable place to hook it in. However, I'd like to make > sure that it would work first, and it seems like in principle

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Donny Nadolny
Hi Taha, That would be a reasonable place to hook it in. However, I'd like to make sure that it would work first, and it seems like in principle it's the same as the 4th way I tried (which didn't work): store the current version when the form is rendered, then when you save you grab the latest fro

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Taha Hafeez
Hi Donny One way I can think of is extend AbstractSessionPersistentFieldStrategy as is done by EntityPersistentFieldStrategy(tapestry-hibernate) and store version in addition to id and type in PersistedEntity and later while retrieving the value, check the version too Take a lot at https://svn.a

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Donny Nadolny
Hi Josh, Yup, it must be. The question is, how do I stop that? I tried following the example from the jumpstart demo but it didn't work, and I tried setting the version field manually, and it still didn't work (the exact code I used is in the initial email). On Sun, May 29, 2011 at 12:11 PM, Josh

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Josh Canfield
I would guess that you are pulling the object from the database when you post the form, and thus editing the current version. I believe is the default behaviour with the tapestry persistent object translator, it stores the type and id in the form. Josh On May 29, 2011 7:34 AM, "Donny Nadolny" wr

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Donny Nadolny
Hi Taha, I've tried it having the application update it instead: I opened my "Edit user" page, I hit a page that updated that user, and then I hit save in the "Edit user" page and it overwrote the changes. When I tried just hitting two pages that update the user (grab user, sleep for a bit to make

Re: BeanEditForm for hibernate entity with version field

2011-05-29 Thread Taha Hafeez
Updating the database directly is not advisable when working with hibernate and might be the culprit here. Can you test it by updating the instance using hibernate instead. regards Taha On Sun, May 29, 2011 at 8:04 PM, Donny Nadolny wrote: > I've got a BeanEditForm for my User entity which has