Skip to content

Expose a new method JdbcOperationsSessionRepository#setSessionAttributeTableName() #1347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
moleksyuk opened this issue Mar 12, 2019 · 3 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@moleksyuk
Copy link

I've got problem with defining custom names for SPRING_SESSION & SPRING_SESSION_ATTRIBUTES tables.

I can override just table name for SPRING_SESSION by org.springframework.session.jdbc.JdbcOperationsSessionRepository#setTableName
BUT for I would like to have org.springframework.session.jdbc.JdbcOperationsSessionRepository#setSessionAttributeTableName
because I would like to define tables with the same naming convention as it already exists in my schema (all tables in lower case) but will get:
session - aka SPRING_SESSION
session_ATTRIBUTES - aka SPRING_SESSION_ATTRIBUTES
which look strange 😞

@vpavic
Copy link
Contributor

vpavic commented Aug 29, 2019

After doing some tests, this appears to be an issue specific to MySQL/MariaDB. All other databases we're testing against do not exhibit such case insensitivity.

With that in mind I'm closing this as declined, especially since there are other options do work around this:

  • configuring MySQL to use case-insensitive identifiers
  • configuring custom SQL on JdbcOperationsSessionRepository

@vpavic vpavic closed this as completed Aug 29, 2019
@vpavic vpavic added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 29, 2019
@s3curitybug
Copy link

Can we reconsider this?

I'm having the same problem: my table names are all lower case, I set the property spring.session.jdbc.table-name = spring_session, but I get queries to the table spring_session_ATTRIBUTES. I'm using Google Cloud MySQL 8.0 as a service, which is case sensitive and does not support the flag lower_case_table_names (https://cloud.google.com/sql/docs/mysql/flags#list-flags-mysql) to make it insensitive. So the queries fail.

Configuring custom SQL on JdbcIndexedSessionRepository just for this seems overengineering to me.

Thank you.

@vpavic
Copy link
Contributor

vpavic commented Mar 3, 2021

I think Spring Session could indeed be a bit friendlier here as developers often times have little to no control over the database they need to use, while also having to adhere so some rules.

I'll try to give this another round of consideration.

@vpavic vpavic reopened this Mar 3, 2021
@vpavic vpavic added status: waiting-for-triage An issue we've not yet triaged and removed status: declined A suggestion or change that we don't feel we should currently apply labels Mar 3, 2021
@vpavic vpavic removed their assignment Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants