2 * Tests pessimistic locking "lock" method
4 * @author Graeme Rocher
11 package org
.codehaus
.groovy
.grails
.orm
.hibernate
12 class PessimisticLockingTests
extends AbstractGrailsHibernateTests
{
14 void testLockMethod() {
15 def domainClass
= ga
.getDomainClass("Book2")
17 def book
= domainClass
.newInstance()
19 book
.title
= "The Stand"
25 book
= domainClass
.clazz
.get(1)
28 book
.title
= "The Shining"
33 void testLockStaticMethod() {
34 def domainClass
= ga
.getDomainClass("Book2").clazz
36 def book
= domainClass
.newInstance()
38 book
.title
= "The Stand"
43 book
= domainClass
.lock(1)