(Quick Reference)

withNewSession

目的
Purpose

Provides a way to execute code within the context of a new Hibernate session which shares the same transactional (JDBC Connection) resource as the currently bound session.

使用例
Examples

Book.withNewSession { session ->
    // do work
}

詳細
Description

パラメータ:

Parameters:
  • closure - A closure which accepts a Session argument