当前位置: 动力学知识库 > 问答 > 编程问答 >

spring - Hibernate OptimisticLocking not working

问题描述:

I am using Hibernate 3.6.6 with Sping 3.0.4

After adding

@org.hibernate.annotations.Entity(optimisticLock=OptimisticLockType.ALL, dynamicUpdate=true)

to my bean and running following testcase

SSNConceptDAO conceptDao = (SSNConceptDAO)Context.getBean("conceptDAO");

SSNConcept ssnConcept = conceptDao.findById(9000000612l);

ssnConcept.setEditornote("Editor Note at "+System.currentTimeMillis());

conceptDao.update(ssnConcept);

Hibernate Don't add proper WHERE Clause to the update statement

However in an other application I am only using Hibernate without Spring, same settings are working perfectly alright.

分享给朋友:
您可能感兴趣的文章:
随机阅读: