We must use many datasets in grails application. Per user i.e per URL session (from logging user's logout) takes the application to different data sources depending on the user's request.
The above link provides a good solution for this. We have modified in that page, with modified dynamic configuration. It's working well
1) But how does the code switch from session to session data source? 2) What is the use of Please explain. . Thank you. Grails connects requests with thread. A So, what is this in its flow: User Before When thread local referrer in this code?
threadlocal variable holds a different value for each thread that it accesses (allows thread security without synchronization).
environment in
environment controller Chooses, which controls the user in the session.
filer he looks at each request and determines that the user session has a
environment if So, he sets the
environment holder to indicate that environment because it is a
threadlocal , so each thread (in this case: the request) can have its own value is.
dataSource has reached the beam, its
switchable data source will be correct code source to the
environment holder Chooses based on the values held in the
ThreadLocal value of .
No comments:
Post a Comment