I’d like to know if it’s possible with grails to specify a scope for the domain classes.
Few words to explain how my application is working at the moment:
– database access is done through an external “module” using SQLJ. This module is user by controllers in my grails app.
– a user ask for specific information submitting forms -> request submitted to the external module -> information extracted from the database -> information loaded into grails mem DB (HSQL) -> information displayed in views.
It works fine in development environment as i’m the only one using the application. But i’m wondering how the application would behave with two or more users. I mean, do the information loaded into grails memory database will be shared between users or not? And how not to shared information requested by one user with the others?
Thanks in advance for any help about this subject.
Regards.
All data in the database is shared across all users of the grails application. You would have to write a custom query to limit the data returned to a specific user. Based on your application maybe something similar to the following.
To get data into an instance of your domain class.
Then when you want to display info for the user with the userId 5