(String id)
| 401 | } |
| 402 | |
| 403 | @Override |
| 404 | public Session load(String id) throws ClassNotFoundException, IOException { |
| 405 | org.apache.catalina.Context context = getManager().getContext(); |
| 406 | Log contextLog = context.getLogger(); |
| 407 | String loadSql = "SELECT " + sessionIdCol + ", " + sessionDataCol + " FROM " + sessionTable + " WHERE " + |
| 408 | sessionIdCol + " = ? AND " + sessionAppCol + " = ?"; |
| 409 | |
| 410 | Session session = withRetry((ConnectionOperation<StandardSession,ClassNotFoundException>) conn -> { |
| 411 | ClassLoader oldThreadContextCL = context.bind(null); |
| 412 | |
| 413 | try (PreparedStatement preparedLoadSql = conn.prepareStatement(loadSql)) { |
| 414 | preparedLoadSql.setString(1, id); |
| 415 | preparedLoadSql.setString(2, getName()); |
| 416 | try (ResultSet rst = preparedLoadSql.executeQuery()) { |
| 417 | if (rst.next()) { |
| 418 | try (ObjectInputStream ois = getObjectInputStream(rst.getBinaryStream(2))) { |
| 419 | if (contextLog.isTraceEnabled()) { |
| 420 | contextLog.trace(sm.getString("dataSourceStore.loading", id, sessionTable)); |
| 421 | } |
| 422 | |
| 423 | StandardSession _session = (StandardSession) manager.createEmptySession(); |
| 424 | _session.readObjectData(ois); |
| 425 | _session.setManager(manager); |
| 426 | return _session; |
| 427 | } |
| 428 | } else if (context.getLogger().isDebugEnabled()) { |
| 429 | contextLog.debug(sm.getString("dataSourceStore.noObject", id)); |
| 430 | } |
| 431 | return null; |
| 432 | } |
| 433 | } finally { |
| 434 | context.unbind(oldThreadContextCL); |
| 435 | } |
| 436 | }); |
| 437 | return session; |
| 438 | } |
| 439 | |
| 440 | @Override |
| 441 | public void remove(String id) throws IOException { |
nothing calls this directly
no test coverage detected