1
我的Grails測試:Grails的測試和@Transactional
class GormTests extends GroovyTestCase {
static transactional = false
...
}
我試圖標記方法,通過org.springframework.transaction.annotation.Transactional
註釋事務,但以下情況例外出現:
org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class GormTests]: Common causes of this problem include using a final class or a non-visible class; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
我怎樣才能解決呢?
是否必須使用'withTransaction'閉包,例如'SomeDomainClass.withTransaction {//一些邏輯。 }如果他們想要使用'.find()'函數,而在定義了'static transactional = false'的集成測試中? –