From f10a1d709bf288f27a8d0d58de830067f519528c Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Mon, 6 May 2013 12:24:53 +1000 Subject: [PATCH] 407173 java.lang.IllegalStateException: null when using JDBCSessionManager --- .../server/session/JDBCSessionManager.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java index ffdfa41e966..85a8566734e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java @@ -294,17 +294,20 @@ public class JDBCSessionManager extends AbstractSessionManager super.complete(); try { - if (_dirty) + if (isValid()) { - //The session attributes have changed, write to the db, ensuring - //http passivation/activation listeners called - willPassivate(); - updateSession(this); - didActivate(); - } - else if ((getAccessed() - _lastSaved) >= (getSaveInterval() * 1000L)) - { - updateSessionAccessTime(this); + if (_dirty) + { + //The session attributes have changed, write to the db, ensuring + //http passivation/activation listeners called + willPassivate(); + updateSession(this); + didActivate(); + } + else if ((getAccessed() - _lastSaved) >= (getSaveInterval() * 1000L)) + { + updateSessionAccessTime(this); + } } } catch (Exception e)