|
Re: Setting the current user id in 2.2: msg#00737cms.sakai.devel
Josh - The user directory service impl caches the current user in the thread. So if you have already asked for the current user (or any code has so to trigger the caching), then change user, then ask again, all in the same thread, things might not work. After setting the user and eid in the session, you can ask the thread local manager to clear the thread - that will reset any thread caching, including the user directory service: ThreadLocalManager.clear(); See if that does the trick. The user directory service impl. uses this to get the current user id: String id = sessionManager().getCurrentSessionUserId(); so this really should work! Non-request processing code in Sakai like the tests and background threads should keep this caching in mind (many services do it) and clear the thread at appropriate times (emulating the end of a typical end-user request processing cycle). - Glenn Glenn R. Golden Software Architect, University Of Michigan ggolden@xxxxxxxxx On Apr 18, 2006, at 5:55 PM, Josh Holtzman wrote: It almost works with: [see attachment: "message0.html", size: 10249 bytes] Attachments: message0.html http://collab.sakaiproject.org/access/content/attachment/d41086f1-959e-4389-0008-d9b7aeb50b70/message0.html ---------------------- This automatic notification message was sent by Sakai Collab (http://collab.sakaiproject.org/portal) from the DG: Development site. You can modify how you receive notifications at My Workspace > Preferences. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Correct way to check if user is logged in?: 00737, Glenn R. Golden |
|---|---|
| Next by Date: | Re: Setting the current user id in 2.2: 00737, Charles Severance |
| Previous by Thread: | Re: Setting the current user id in 2.2i: 00737, Josh Holtzman |
| Next by Thread: | Re: Setting the current user id in 2.2: 00737, Charles Severance |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |