1.

How You Can Make A Method Not Transactional If The Whole Class Was Marked As Transactional?

Answer»

using the ANNOTATION @NotTransactional above the method's NAME in the service

EXAMPLE:

IMPORT grails.transaction.Transactional

@Transactional
class BookService {
@NotTransactional
def listBooks() {
Book.list()
}
}

using the annotation @NotTransactional above the method's name in the service

Example:

import grails.transaction.Transactional

@Transactional
class BookService {
@NotTransactional
def listBooks() {
Book.list()
}
}



Discussion

No Comment Found