您应该使用withNewSession - 请参阅http://adhockery.blogspot.com/2010/01/upgrading-grails-11-12.html
编辑:为1.1.x添加:
如果您还没有使用1.2并且withNewSession()不可用,您可以在BootStrap中自己连接:
import org.hibernate.Session import org.springframework.orm.hibernate3.HibernateCallback import org.springframework.transaction.support.TransactionSynchronizationManager import org.springframework.orm.hibernate3.SessionHolder import org.springframework.orm.hibernate3.HibernateTemplate class BootStrap { def grailsApplication def sessionFactory def init = { servletContext -> for (domainClass in grailsApplication.domainClasses) { domainClass.metaClass.static.withNewSession = { Closure callable -> HibernateTemplate template = new HibernateTemplate(sessionFactory) SessionHolder sessionHolder = TransactionSynchronizationManager.getResource(sessionFactory) Session previousSession = sessionHolder?.session try { template.alwaysUseNewSession = true template.execute({ Session session -> sessionHolder.addSession(session) callable(session) } as HibernateCallback) } finally { if (previousSession) { sessionHolder.addSession(previousSession) } } } } } def destroy = {} }