1.

How Do You Use Pessimist Looking In A Domain Class?

Answer»

Call ".lock()" METHOD on domain instance.

Example.

def airport = Airport.get(10)
airport.lock() // lock for update
airport.name = "Heathrow"
airport.save()
 
or defining in your domain CLASS "version= false"
Example:
class Person {

static MAPPING = {
version false // here you disability OPTIMIST looking
autoTimestamp false
}
}

Call ".lock()" method on domain instance.

Example.

def airport = Airport.get(10)
airport.lock() // lock for update
airport.name = "Heathrow"
airport.save()
 
or defining in your domain class "version= false"
Example:
class Person {

static mapping = {
version false // here you disability optimist looking
autoTimestamp false
}
}



Discussion

No Comment Found