statement.setString(9, data.getRowId()); //rowId statement.executeUpdate();
statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled())
/** * Delete a session from the database. Should only be called * when the session has been invalidated. * * @param data the session data * @throws Exception if unable to delete the session */ protected void deleteSession (Session data) throws Exception { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_jdbcSessionIdMgr._deleteSession)) { connection.setAutoCommit(true); statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled()) LOG.debug("Deleted Session "+data); } }
statement.setLong(4, now); statement.setLong(5, data.getExpiryTime()); statement.setString(6, data.getRowId()); statement.executeUpdate(); data.setLastSaved(now);
statement.setString(7, data.getRowId()); //rowId statement.executeUpdate();
statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); statement.close();
statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled())
statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); statement.close();
statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled())
/** * Update the node on which the session was last seen to be my node. * * @param data the session * @throws Exception */ protected void updateSessionNode (Session data) throws Exception { String nodeId = getSessionIdManager().getWorkerName(); Connection connection = getConnection(); PreparedStatement statement = null; try { connection.setAutoCommit(true); statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); statement.close(); if (LOG.isDebugEnabled()) LOG.debug("Updated last node for session id="+data.getId()+", lastNode = "+nodeId); } finally { if (connection!=null) connection.close(); } }
statement.setLong(4, now); statement.setLong(5, data.getExpiryTime()); statement.setString(6, data.getRowId()); statement.executeUpdate(); data.setLastSaved(now);
/** * Delete a session from the database. Should only be called * when the session has been invalidated. * * @param data * @throws Exception */ protected void deleteSession (Session data) throws Exception { Connection connection = getConnection(); PreparedStatement statement = null; try { connection.setAutoCommit(true); statement = connection.prepareStatement(_jdbcSessionIdMgr._deleteSession); statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled()) LOG.debug("Deleted Session "+data); } finally { if (connection!=null) connection.close(); } }
statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); statement.close();
statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); statement.close();
statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled())
/** * Persist the time the session was last accessed. * * @param data the session * @throws Exception */ private void updateSessionAccessTime (Session data) throws Exception { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionAccessTime)) { long now = System.currentTimeMillis(); connection.setAutoCommit(true); statement.setString(1, getSessionIdManager().getWorkerName()); statement.setLong(2, data.getAccessed()); statement.setLong(3, data.getLastAccessedTime()); statement.setLong(4, now); statement.setLong(5, data.getExpiryTime()); statement.setLong(6, data.getMaxInactiveInterval()); statement.setString(7, data.getRowId()); statement.executeUpdate(); data.setLastSaved(now); } if (LOG.isDebugEnabled()) LOG.debug("Updated access time session id="+data.getId()+" with lastsaved="+data.getLastSaved()); }
/** * Persist the time the session was last accessed. * * @param data the session * @throws Exception */ private void updateSessionAccessTime (Session data) throws Exception { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionAccessTime)) { long now = System.currentTimeMillis(); connection.setAutoCommit(true); statement.setString(1, getSessionIdManager().getWorkerName()); statement.setLong(2, data.getAccessed()); statement.setLong(3, data.getLastAccessedTime()); statement.setLong(4, now); statement.setLong(5, data.getExpiryTime()); statement.setLong(6, data.getMaxInactiveInterval()); statement.setString(7, data.getRowId()); statement.executeUpdate(); data.setLastSaved(now); } if (LOG.isDebugEnabled()) LOG.debug("Updated access time session id="+data.getId()+" with lastsaved="+data.getLastSaved()); }
/** * Delete a session from the database. Should only be called * when the session has been invalidated. * * @param data * @throws Exception */ protected void deleteSession (Session data) throws Exception { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_jdbcSessionIdMgr._deleteSession)) { connection.setAutoCommit(true); statement.setString(1, data.getRowId()); statement.executeUpdate(); if (LOG.isDebugEnabled()) LOG.debug("Deleted Session "+data); } }
/** * Update the node on which the session was last seen to be my node. * * @param data the session * @throws Exception if unable to update the session node */ protected void updateSessionNode (Session data) throws Exception { String nodeId = getSessionIdManager().getWorkerName(); try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode)) { connection.setAutoCommit(true); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); } if (LOG.isDebugEnabled()) LOG.debug("Updated last node for session id="+data.getId()+", lastNode = "+nodeId); }
/** * Update the node on which the session was last seen to be my node. * * @param data the session * @throws Exception */ protected void updateSessionNode (Session data) throws Exception { String nodeId = getSessionIdManager().getWorkerName(); try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_jdbcSessionIdMgr._updateSessionNode)) { connection.setAutoCommit(true); statement.setString(1, nodeId); statement.setString(2, data.getRowId()); statement.executeUpdate(); } if (LOG.isDebugEnabled()) LOG.debug("Updated last node for session id="+data.getId()+", lastNode = "+nodeId); }