Can I configure Grails with no datasource?

后端 未结 4 1415
猫巷女王i
猫巷女王i 2020-12-05 14:18

I have a Grails app that loads its data from xml files and delivers rss feeds via rome. I don\'t have any domain classes and my app has no datasource. I don\'t want Grails t

4条回答
  •  广开言路
    2020-12-05 14:26

    This is a good guide: http://digitalbreed.com/2011/using-grails-without-a-database

    Remove Grails’ Hibernate plugin.

    1. grails uninstall-plugin hibernate
    2. Delete the datasource configuration file conf/DataSource.groovy
    3. Explicitly declare services as non-transactional. The default is true and your class methods would be proxied, but without the Hibernate plugin there is no transaction manager and the deployment will fail.

      class SomeService { static transactional = false // ... }

    4. Use command objects instead of domain objects, particularly if you need validation.

提交回复
热议问题