Delayed SessionFactory Creation in Grails
Monday, January 25th, 2010The topic of delaying DataSource
and SessionFactory
creation until some point after startup has come up a few times on the Grails user mailing list so I thought I’d give it a shot. I got it working, but it’s not pretty.
Grails (and Hibernate) will create up to three connections during initialization so the primary focus is to avoid those. In addition the DataSource
will pre-instantiate connections, so we’ll delay those as well.
(more…)