In grails, I have a Domain class and can be queried in BootStap.groovy
def xref = AppXref.find{user_nm == \'john\'}
However, once I moved
domain class methods are NOT transactional, so you have to make sure, that they are invoked in a TX-context: either put them in a service, or use .withTransaction{}
.withTransaction{}
Adding @Transactional on the method worked for me.
@Transactional