It's much better practice to set the ThreadLocal as final and static, in my experience. i.e.
private static final ThreadLocal<UserData> localUser = new ThreadLocal<UserData>(); If you don't do this, then you've got the danger that a separate thread can re-initialise the ThreadLocal between your first and second statement. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/HOVUBnN0a08J. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.