dirty « Transaction « JPA Q&A





1. Hibernate3 is not firing the update query (dirty checking) for the transaction    stackoverflow.com

Need help regarding hibernate3. We are hibernatetemplate in our project. We can able to get, insert but not able to do update persistent objects. I know that hibernate uses dirty checking ...

2. How does an explicit EntityManager.lock() call prevent dirty reads in JPA    java.net

i'm trying to understand the behaviour of the EntityManager.lock() call. The Sun documentation ( http://java.sun.com/javaee/5/docs/api/javax/persistence/LockModeType.html) on this is a bit confusing for me and i will explain why. It says that if T1 calls EntityManager.lock() on an entity, then T2 couldn't make a dirty read. Also i read here (http://www.nabble.com/JPA-locking-td19525631.html) that " The lock() API acquires an optimistic lock, not a ...

3. Nested transaction or dirty write    forum.hibernate.org

Hi all, I have a question about transaction demarcation. To ensure that a long operation is correctly committed or rollbacked completely, I gave my starting method Propagation.REQUIRES_NEW and the methods called from it Propagation.MANDATORY. One of these methods is a counter that is incremented (used to generate unique filenames). This part of the transaction should never be rollbacked, because then files ...

4. Why can't I lock/reattach an entity with a dirty collection?    forum.hibernate.org

Newbie Joined: Fri Oct 06, 2006 8:09 pm Posts: 5 Location: Costa Mesa, CA We are using Hibernate 3.3.2.GA, with optimistic locking via @Version and the session per request pattern (and thus detached entity object graphs). We have a very complex object graph consisting of carts, orders, line items, sub line items, payments, delivery, sub line item deliveries, etc. In most ...

5. Difference between optimistic-lock for dirty and all    forum.hibernate.org

Hibernate docs are curiously brief on this subject so any clarification will be appreciated. Does optimistic-lock="dirty" mean the user is allowed to update a stale object as long as the columns the user is trying to change haven't been changed by the prior update? If not, is there a way to enforce this type of optimistic lock? Majority of our entities ...

6. Only commit certain dirty objects    forum.hibernate.org

I would like to update only certain objects in my object graph, and include dirty-checking. e.g. SessionStart Read objA, objB, objC from DB ... Change objB and objC in Java ... //I know I want to update objA and objC only Hibernate will update only objC //since objA is not dirty Commit //and objB is not changed in DB The first ...

7. optimistic-lock="dirty" causing ORA-01008: not all    forum.hibernate.org

Author Message mjessee Post subject: optimistic-lock="dirty" causing ORA-01008: not all Posted: Fri Aug 20, 2004 2:55 pm Newbie Joined: Mon Mar 08, 2004 8:57 pm Posts: 6 Hibernate version: 2.1.6 Mapping documents: ...

8. optimistic-lock=dirty being batched incorrectly    forum.hibernate.org

When using hibernate.jdbc.batch_versioned_data=false and optimistic-lock=dirty, hibernate will use jdbc batching to perform updates. This means that if the data has been changed in the db, the updates will not take place, but hibernate will throw no exceptions. It looks like that in the AbstractEntityPersister class method as follows: public boolean isBatchable() { return jdbcBatchVersionedData || !isVersioned(); } should return false in ...





10. dirty collection exception when using lock    forum.hibernate.org

Hi, I'm reading in a graph using SQL and then constructing my java objects from the results. I would like to then add the newly instantiated objects to the cache using lock(). I've included the @Cascade(CascadeType.LOCK) to the associations, but I'm getting a dirty collection error. It seems that when it looks at the collection downstreamStatusValues, the OnLockVisitor class determines that ...

11. Transaction, Association, dirty collections    forum.hibernate.org

Newbie Joined: Wed Feb 22, 2006 9:30 am Posts: 13 Location: Cologne, Germany Hibernate version: 3.2 Name and version of the database you are using: MySQL 4 Hi everybody, I'm having a strange problem regarding transactions and re-associated objects. During a checkout process I'm collecting the pieces of information needed for a complete order. This is done using several distinct requests. ...

12. Dirty reads without changing transaction isloation?    forum.hibernate.org

I have a legacy database that I'm mapping with hibernate, and my DBAs are asking if I can make my hibernate statements use dirty reads. I know all of the issues this brings up, and I know it's not safe. And, I've been through all of those discussions with my DBAs and they're not statisfied. I know I can turn down ...