Using Grails without a database

Using Grails without a database

If you’re using Grails for a frontend without direct database access, there are four things you need to do.

  1. Remove Grails’ Hibernate plugin.
    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.

Next Article

9 out of 10 startups fail

I was interested in whether there's any truth in this startup-scene meme, so I took some time to walk through 13 startups who presented 30 second pitches at Web 2.0 summit 2010, a little more than one year ago.

No Comments

Cancel