Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE SPRING_SESSION (
LAST_ACCESS_TIME BIGINT NOT NULL,
MAX_INACTIVE_INTERVAL INT NOT NULL,
EXPIRY_TIME BIGINT NOT NULL,
PRINCIPAL_NAME VARCHAR(100),
PRINCIPAL_NAME NVARCHAR(100),
Copy link

@ronodhirSoumik ronodhirSoumik Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:: using NVARCHAR instead VARCHAR will lower max length capacity
For VARCHAR: 8k Chars but for NVARCHAR: 4k Chars
will that be a concern in this case (in future)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!

While it is true that NVARCHAR has a lower maximum capacity compared to VARCHAR, the column is explicitly defined as NVARCHAR(100) here, which is well within the 4,000-character limit of NVARCHAR.

Given that PRINCIPAL_NAME typically stores usernames, 100 characters is currently sufficient. Does the team have any roadmap or plans to extend this field's maximum capacity beyond 4,000 characters in the future? > If not, aligning with NVARCHAR would be beneficial to avoid the implicit conversion performance costs caused by the JDBC driver's default behavior.

CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID)
);

Expand All @@ -15,7 +15,7 @@ CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME);

CREATE TABLE SPRING_SESSION_ATTRIBUTES (
SESSION_PRIMARY_ID CHAR(36) NOT NULL,
ATTRIBUTE_NAME VARCHAR(200) NOT NULL,
ATTRIBUTE_NAME NVARCHAR(200) NOT NULL,
ATTRIBUTE_BYTES IMAGE NOT NULL,
CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME),
CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) REFERENCES SPRING_SESSION(PRIMARY_ID) ON DELETE CASCADE
Expand Down