tags:

views:

56

answers:

0

Hi,

I want Grails to use a sessionFactory bean defined in resources.xml?

By default, you use DataSource.groovy to define the necessary properties and Grails is automatically creating a sessionFactory called "sessionFactory". I need to define the sessionFactory in resources.xml because I need to use some legacy beans. Both, Grails artefacts and legacy beans should then use the same dataSource and sessionFactory. Therefore, I removed the DataSource.groovy and defined a dataSource as well as a sessionFactory bean in resources.xml. The latter is named "sessionFactory", which is exactly the name as Grails would name it too.

However, it doesn't work. It seems that it is not allowed to call a bean "sessionFactory" in resources.xml. So, one approach would be to define a sessionFactory called other than "sessionFactory" and tell Grails to use that sessionFactory. Is there a way to do so?

Thanks! Stumppi