Announcement Announcement Module
Collapse
No announcement yet.
user Cache in acegi Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • user Cache in acegi

    Hi,

    I am using springs with ACEGI security.
    My issue is that after approx one hour "user" automatically becomes null in the following lines of code:

    UserCache userCache = getUserCache();
    UserDetails user = userCache.getUserFromCache(username);

    Which means i guess the cahche gets cleared after some time.

    How can i stop this from happening ??
    Please Help....!!

  • #2
    You could configure the ehcache settings in ehcache.xml file which should be located in the classpath. I have that file in \WEB-INF\classes folder.

    There you can configure the ACEGI cache settings e.g.
    Code:
    <cache name="userCache" maxElementsInMemory="300" eternal="false"
    		timeToIdleSeconds="600" timeToLiveSeconds="600" overflowToDisk="false"
    		diskPersistent="false" diskExpiryThreadIntervalSeconds="600" />
    If no cache settings are found, ACEGI creates one of its own.

    Note! This example here doesn't solve your problem. Please study the ehcache documentation for the proper values.

    Comment

    Working...
    X