dirty « Version « JPA Q&A





1. Mark object as dirty (version management)    forum.hibernate.org

Hi there, what I am up to is quite simple, I guess. A persistent object has an version attribute storing the object's version and of cause the version property is managed by hibernate. The object also has an one-to-one association. The association herefor is completely transparent to a user of the object (hidden/transparent). So whenever the associated object is manipulated by ...

2. dirty checking, query, flushing and version    forum.hibernate.org

3. Aggressive version column incrementing, even when not dirty    forum.hibernate.org

In hibernate 3.1 + EJB3 annotations, I'm using a hibernate managed version column (@Version). The act of reading an object (but not modifying it), causes its version column to be incremented at every single flush, even when the object is not dirty. For example, I have an object type that is specifically designed to just hold data, and will perhaps be ...

4. save() increments version even if instance is not dirty    forum.hibernate.org

Hibernate version: 3.1.3 I noticed that if I save(foo) its version number is incremented even if it has never been changed (its setters have never even been invoked). This causes concurrency problems because I get StaleObjectStateException even if no data is actually stale. I have cascade="save-update" set which is triggering save(foo) so I don't really control this. I expect foo to ...

5. JPA @Version problem (dirty context?)    forum.hibernate.org

I am calling persist on my entity which results in the correct insert statements, but then at the end of the transaction, a mysterious update is called which bumps up the @Version number. Since I copy the the entity to a DTO before the transaction is complete, the returned DTO has an older version number which is causing optimistic locking problems. ...