-
1. Re: EntityHome and optimistic transaction
hstang Jul 11, 2007 2:38 PM (in response to azalea)What does "edit" button do? does it call entityHome.update ? Maybe somewhere the dirty flag is not being set and you may to forcefully set that dirty flag to force update.
-
2. Re: EntityHome and optimistic transaction
azalea Jul 11, 2007 5:18 PM (in response to azalea)Hi, hstang.
Thanks for your reply.
What does "edit" button do? does it call entityHome.update ?
Yes, it does.
Maybe somewhere the dirty flag is not being set and you may to forcefully set that dirty flag to force update.
I tried setDirty(), but the situation didn't change.@Name("personManager") public class PersonManager extends EntityHome<Person> { ... ... @Begin(join=true) public void startUpdate() { setDirty(); // added } @End public void update() { setDirty(); // added super.update(); } }
I think I need to see the Seam source code in detail.
Your help is a welcome anytime :)
Thanks. -
3. Re: EntityHome and optimistic transaction
hstang Jul 11, 2007 7:18 PM (in response to azalea)Hello,
I suspect it might not be related to Seam and maybe Hibernate, (if that's what you are using as your JPA provider). This is just my guess though. -
4. Re: EntityHome and optimistic transaction
azalea Jul 11, 2007 8:37 PM (in response to azalea)Hi,
I think so, too.
maybe Hibernate's automatic dirty checking ...
Because I'm newbie in not oly Seam but also Hibernate,
I can't still find the solutions :(
I will search hibernate forum or/and buy Gavin's book :) -
5. Re: EntityHome and optimistic transaction
pmuir Jul 12, 2007 6:01 AM (in response to azalea)You probably need to extend EntityHome with some custom logic to detect this sort of situation.
-
6. Re: EntityHome and optimistic transaction
azalea Jul 12, 2007 7:48 PM (in response to azalea)Hi, pete.
Thanks for your comment.
I'll try to write my dirty checking code. -
7. Re: EntityHome and optimistic transaction
lisaanm Jul 13, 2007 4:29 AM (in response to azalea)Hi,
Under the same circumstance (original post), i achieved expected result by using Hibernate's @version annotation.
Here's link for Hib dochttp://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#entity-mapping-entity-version
Hope this helps -
8. Re: EntityHome and optimistic transaction
azalea Jul 13, 2007 12:53 PM (in response to azalea)Hi, lisaanm.
Thanks for your help.
I was also able to solve the problem by using @Version and EntityManager.lock() :)
Thanks a lot.