[java-plugin-storage-jdbc] branch main updated: JJDBC-12 Context Size claims to be too small for StorageBackedSessionManager

Rod Widdowson rdw at steadingsoftware.com
Mon Jul 11 10:00:34 UTC 2022


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-plugin-storage-jdbc.

View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-storage-jdbc.git;a=commit;h=85e723b715c8d33d9735acc2e0fbe21558fe4410

The following commit(s) were added to refs/heads/main by this push:
     new 85e723b  JJDBC-12 Context Size claims to be too small for StorageBackedSessionManager
85e723b is described below

commit 85e723b715c8d33d9735acc2e0fbe21558fe4410
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Jul 10 15:42:00 2022 +0100

    JJDBC-12 Context Size claims to be too small for StorageBackedSessionManager
    
    https://shibboleth.atlassian.net/browse/JJDBC-12
    
    Set the context & keysize to be 255 and the valueSize to be Integer.MAX_VALUE
---
 .../plugin/storage/jdbc/impl/JDBCStorageRecord.java          |  8 +++++++-
 .../plugin/storage/jdbc/impl/JDBCStorageService.java         | 12 +++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageRecord.java b/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageRecord.java
index ff5be43..177540e 100644
--- a/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageRecord.java
+++ b/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageRecord.java
@@ -31,7 +31,13 @@ import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
  */
 class JDBCStorageRecord<T> extends MutableStorageRecord<T> {
 
-    /**
+    /** Length of the context column. */
+    public static final int CONTEXT_SIZE = 255;
+
+    /** Length of the key column. */
+    public static final int KEY_SIZE = 255;
+
+   /**
      * Constructor.
      *
      * @param val The value to store
diff --git a/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageService.java b/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageService.java
index aa10644..25b15a6 100644
--- a/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageService.java
+++ b/jdbc-storage-impl/src/main/java/net/shibboleth/plugin/storage/jdbc/impl/JDBCStorageService.java
@@ -80,7 +80,8 @@ public final class JDBCStorageService extends AbstractStorageService implements
     static final String DEFAULT_PRE_CREATE_QUERY_SQL = "SELECT expires FROM StorageRecords WHERE context =? AND id=?";
 
     /** The SQL to create a new record. */
-    static final String DEFAULT_CREATE_CREATE_RECORD_SQL = "INSERT INTO StorageRecords(context, id, expires, value, version) VALUES (?, ?, ?, ?, 1)";
+    static final String DEFAULT_CREATE_CREATE_RECORD_SQL =
+              "INSERT INTO StorageRecords(context, id, expires, value, version) VALUES (?, ?, ?, ?, 1)";
 
     /** The SQL to update an expired record as part of a create. */
     static final String DEFAULT_CREATE_UPDATE_RECORD_SQL =
@@ -232,6 +233,15 @@ public final class JDBCStorageService extends AbstractStorageService implements
      */
     @Nonnull @NotEmpty private String deleteByContextSQL = DEFAULT_DELETE_BY_CONTEXT_SQL;
 
+    /** Constructor.
+     * Set the defaults so that they can be over-ridden by Spring.
+     */
+    public JDBCStorageService() {
+        setContextSize(JDBCStorageRecord.CONTEXT_SIZE);
+        setKeySize(JDBCStorageRecord.KEY_SIZE);
+        setValueSize(Integer.MAX_VALUE);
+    }
+
     /* Bean Setters*/
     /** set {@link #transactionRetries}.
      * @param count how many time to try before we bail.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list