Search code examples
cachingjakarta-eeglassfishjdbcrealm

Does jdbcRealm use cache? (Glassfish server)


Does com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm use caching?

Let me describe my situation. When I use file realm on my application, everything works Ok, but when I try to use remote DB I have strange behavior. Actually authentication works well, but client app start throwing exceptions.

My application frequently (every 200 ms) send requests to Glasswish appserver via JAX-RS.

So I suppose that realm does not manage to finish before the other starts. And if I'm right, then caching can solve my problem, but I cannot fint that options in glassfish.


Solution

  • I exam JDBCrealm code from http://kickjava.com/src/com/sun/enterprise/security/auth/realm/jdbc/JDBCRealm.java.htm

    It caches only groups. To cache users I use this lib: http://flexiblejdbcrealm.wamblee.org/site/