gorm « Transaction « JPA Q&A





1. Concurrency when using GORM in Grails    stackoverflow.com

Let's say I have a counter function which updates a counter using raw SQL:

 public void updateCounter() {
   executeSql("UPDATE counter SET count_value = count_value + 1 WHERE id = ...

2. How To Make Transactions Work In Grails    stackoverflow.com

Summary A parent can have many children. How do you write a service such that, if after adding a parent there is an error when adding a child, the entire transaction is ...

3. Disabling locking for non-critical Grails/GORM domain classes    stackoverflow.com

Assume the following code in a Grails controller:

def action = {
  ClassName o = ClassName.findByFoo(params.foo)
  if (o) {
    o.counter += 1
  }
}
By default Grails uses ...

4. Grails optimistic locking strange behaviour    stackoverflow.com

I've been trying to make GORM throw an optimistic locking error in an integration test. It has been said before that it is not possible to test for concurrent update ...

5. Grails: issue when calling a service method from other service method    stackoverflow.com

I have this 2 methods in the same service class:

boolean meth1(DomClass dom1) { //parameter is an instance of domain class DomClass
    ...
    meth2(dom1)
   ...