User cache

7 views
Skip to first unread message

jaga

unread,
Nov 16, 2009, 4:59:34 AM11/16/09
to ToCollege-net
Hi Jeff,

I noticed there are comments regarding 'flaky' code for manual user
cache maintenance -- see UserServiceImpl.java . What is the problem
exactly and have you figured out a solution to it? Doesn't Spring
provide tools for this?

Cheers

Jaga

jdwy

unread,
Nov 16, 2009, 9:32:51 AM11/16/09
to ToCollege-net
Hey Jaga,
Not quite sure what you're referring to. Did I say it was flaky
somewhere?
-Jeff

jaga

unread,
Nov 23, 2009, 4:26:46 AM11/23/09
to ToCollege-net
Hi Jeff,

Sorry about the reference to the work 'Flaky' in your code comment. In
the file
UserServiceImpl.java I was worried by the implications hinted at by
the code comment at the
top of the file. I am aware that nothing is perfect, however, so a
hint at the severity of this would be more than enough.

Thanks

Jaga

jdwy

unread,
Nov 23, 2009, 6:03:05 PM11/23/09
to ToCollege-net
Hey Jaga,

No problem, I just wasn't sure what you were referring to.
http://github.com/jdwyah/tocollege.net/blob/master/src/main/java/com/apress/progwt/server/service/impl/UserServiceImpl.java

Yeah, I guess the bit I don't like is changePassword() method, though
afaik this was how you're supposed to do it in Spring Security. I
guess to me it doesn't feel like updating the user cache should be a
concern of the password change service. Just a general thing, but I
would prefer to have caches expire in a more general manner eg in
Rails I'd probably add after_save to the User model which cleared the
cache.

I don't think there's anything you need to be worried about, I just
felt like there should be a better place for that code. And you'll
need to remember that if you have other methods that modify the cached
user you'll need to clear the cache there too. Not a huge deal.

-Jeff
Reply all
Reply to author
Forward
0 new messages