leftovers...

about grails groovy

Grails 2.4.3 バグフィックスリリース!Hibernateでの注意点ある

Grails 2.4.3 バグフィックス版リリース!
そもそも、Grails 2.4.xて何?って人はコチラもチェック!
Grails 2.4.0 リリースきた!!!!


お約束の流れですがアップデートする場合は、もろもろプラグインのバージョンを更新しましょう。
Hibernateプラグインに関しては必須です。
今回は注意点として、 更新する場合は、DataSource.groovy のhibernate configブロックに flush.mode = 'manual' を追加してください!!

runtime ':hibernate4:4.3.5.5' // or ':hibernate:3.6.10.17'

以下のプラグインは更新推奨です。

build ':tomcat:7.0.54'
compile ':cache:1.1.7'
compile ':scaffolding:2.1.2'
compile ':asset-pipeline:1.9.4'

Hibernate4プラグイン廻りでなんかあったっぽいので意訳してあります。間違ってたらゴメンね。

hibernate4プラグイン、バージョン4.3.5.5でのオートフラッシュのふるまい変更について。

In previous versions, the hibernate4 plugin's flush mode for the Open Session in View Interceptor (OSIVI) has been always "manual" regardless of the setting defined in hibernate config block's "flush.mode" setting. This has been changed to be consistent with hibernate plugin (Hibernate 3). This makes it easier to port existing applications using the hibernate plugin to hibernate4 plugin.

前バージョンまでのhibernate4プラグインで Open Session in View Interceptor (OSIVI)用のフラッシュモードは、hibernate configに"flush.mode"を設定しない限り常にマニュアルモードの状態です。この設定はhibernate3プラグインとの矛盾を防ぐ為に変更される必要があります。設定することにより hibernate3から hibernate4プラグインにポートが容易になります。

IMPORTANT! It is recommended to set Hibernate OSIVI flush mode to "manual" for applications that haven't been upgraded from Hibernate 3 plugin. OSIVI flush mode was always "manual" for plugin versions before 4.3.5.5 version.
Add the "flush.mode = 'manual'" setting to the hibernate config block in grails-app/conf/DataSource.groovy file of your application

重要! Hibernate 3から更新指定無い場合は、Hibernate OSIVIフラッシュモードを"manual"への設定を推奨します。 Hibernateプラグインのバージョン4.3.5.5以前ではOSIVIフラッシュモードは常に"manual"に設定されています。
設定するには grails-app/conf/DataSource.groovy のhibernate configブロックに"flush.mode = 'manual'"を追加します。

hibernate {
   …
   flush.mode = 'manual'
}

It should be noted that the default HibernateTransactionManager switches the flush mode of the current session to AUTO when the transaction starts. This behaviour exists in both Hibernate3 and Hibernate4. The flush mode setting of the OSIVI doesn't have effect in transactional context. The flush mode setting of the current session gets switched to MANUAL for read-only transactions.

注意点として、HibernateTransactionManagerでのデフォルトではフラッシュモードはトランザクションが開始するとセッションがAUTOに切り替わります。Hibernate3 と Hibernate4両方とも同じふるまいをします。フラッシュモードの設定をすることで、リードオンリーのトランザクションがマニュアルに切り替わります。




Grails 2.4.3 の公式リリースノートはこちら。
http://grails.org/2.4.3+Release+Notes
JIRA http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10020&version= 13814
ダウンロード http://grails.org/Download
直リン grails-2.4.3.zip
ドキュメント http://grails.org/doc/2.4.3/