Tapestry 5.2.5 , Tynamo Security 0.3.1 getting unexpected runtime exception on logout.

2011-05-29 Thread cablepuff
Hi i have the following class. Layout.java which has this. Here is in my layout.tml    @Log public Object onActionFromLogout() { this.securityService.getSubject().logout(); try { final Session session =

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

BeanEditForm for hibernate entity with version field

2011-05-29 Thread Donny Nadolny
I've got a BeanEditForm for my User entity which has a version field: @Version public long getVersion() { return version; } public void setVersion(long version) { this.version = version; } I've got an admin screen to edit a user, and I would like to make sure I

Re: [T5.2.5] NPE on form submit

2011-05-29 Thread Donny Nadolny
I can't offer any help, but I remember seeing the same thing a few days ago (and I'm running 5.2.4). It only happened once, on a form submit, but everything worked correctly in the browser (the only reason I noticed was because I was doing development at the time and watching the logs). On Mon, Ma