I am new to Grails and have a question: I set the environment to production and want to make "new" domain variable. I am wondering where it will be stored in db or memory? If in db how could I store it in memory or vice versa (in runtime)?
Asked
Active
Viewed 1,008 times
-1
-
Can you explain what you mean with "store in memory"? You want to make some tests that don't affect the database? – Aug 01 '12 at 19:27
-
1Have you looked at this amazing website http://www.grails.org – bluesman Aug 01 '12 at 19:33
-
yes, that should be temporary. – Reza Aug 01 '12 at 19:34
-
Do you want to have one transient instance or the whole class should be transient? – Victor Sergienko Aug 01 '12 at 20:59
-
Maybe a duplicate of: http://stackoverflow.com/questions/5411537/possible-to-create-a-domain-class-that-is-not-mapped-to-a-database-table or so. – Victor Sergienko Aug 01 '12 at 21:01
-
possible duplicate of [Where should I place a transient domain class in a grails app?](http://stackoverflow.com/questions/5051720/where-should-i-place-a-transient-domain-class-in-a-grails-app) – Victor Sergienko Aug 01 '12 at 21:05
2 Answers
0
The default grails application stores it in "memory" (when run in dev mode) and it depends on the DataSource.groovy setting url = "jdbc:h2:file:~/data/.h2Dev"
If it's file it will be stored in file. If it's mem it will be stored in memory

Ganesh Krishnan
- 7,155
- 2
- 44
- 52