[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Version checks against non-existent objects

areceeyou do-not-reply at jboss.com
Mon Sep 11 05:31:07 EDT 2006


Hi everybody, 
please forgive me, if I'm asking this question for the 10201th time, but I'm really new to this stuff.

I've got some Entity-Beans, which are transferred to a couple of Swing clients. These beans are then existing as POJO's unmanaged on the clients. If one of these clients is removing an entity, a session bean will remove it on the server. The other clients still have the correspondending POJO. If another client will operate on this POJO, e.g. rename its caption, and is then updating it via a session bean (entityManager.merge()), a new entity will be created (standard procedure of merge()).

It seems like there are no version checks against non-existent objects, I was expecting something like an exception: 'Now way, dude, entity was removed before'.

Am I missing something, or have I to do a check manually (i.g. with a special boolean 'removed' column, which has to be checked every time - what a pain)?

Any help is highly appreciated. Thanks in advance.

Rene

P.s.: I'm using optimistic locking with @version and @Id @GeneratedValue.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970687#3970687

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970687



More information about the jboss-user mailing list