You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using JDBC, setting a new attribute multiple times results in an SQL UPDATE not an INSERT. Because there is no row to update, the session attribute is not actually saved to the table.
For example, in a request handler (a Spring MVC controller, servlet, filter, etc):
An alternative solution would be to use an UPSERT for the update SQL instead of an UPDATE... but there's no standard UPSERT support in the SQL standard, so that's probably not a workable approach.
When using JDBC, setting a new attribute multiple times results in an SQL UPDATE not an INSERT. Because there is no row to update, the session attribute is not actually saved to the table.
For example, in a request handler (a Spring MVC controller, servlet, filter, etc):
I would expect a row to be added to the
SPRING_SESSION_ATTRIBUTES
table with theATTRIBUTE_NAME
of "test" and theATTRIBUTE_VALUE
of "someValue"However, what actually happens is that an UPDATE statement is executed resulted in no row being added to
SPRING_SESSION_ATTRIBUTES
.The problem appears to be at https://github.com/spring-projects/spring-session/blob/2.0.3.RELEASE/spring-session-jdbc/src/main/java/org/springframework/session/jdbc/JdbcOperationsSessionRepository.java#L738 - I believe the line should be:
The text was updated successfully, but these errors were encountered: