Index: JDBCStore.java =================================================================== --- JDBCStore.java (revision 766720) +++ JDBCStore.java (working copy) @@ -745,6 +745,11 @@ InputStream in = null; synchronized (this) { + // If sessions already exist in DB, remove and insert again. + // TODO: + // * Check if ID exists in database and if so use UPDATE. + remove(session.getIdInternal()); + int numberOfTries = 2; while (numberOfTries > 0) { Connection _conn = getConnection(); @@ -752,11 +757,6 @@ return; } - // If sessions already exist in DB, remove and insert again. - // TODO: - // * Check if ID exists in database and if so use UPDATE. - remove(session.getIdInternal()); - try { bos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(new BufferedOutputStream(bos));