nebolsin/grails-quartz — pull request #21 by superflav (2011-11-02 03:51:46+00:00)
Title: Persistence interceptor

To get the Grails Quartz plugin to play nicely with the additional datasources that we have defined using the Grails Datasources plugin, we refactored the SessionBinderJobListener to use the persistenceInterceptor to wrap Quartz jobs in a persistence context. If you look at the Datasources implementation, you'll see that it has overridden the default persistenceInterceptor to include dataSourceNames for all of the datasources, not just the default.

In doing this, inspiration was taken from the Grails Executor plugin, which is using this pattern, and which seems to be the preferred way of doing this going forward.

See these URLs for more info:

https://github.com/basejump/grails-executor
http://grails.1312388.n4.nabble.com/PersistenceContextInterceptor-usage-td3513733.html