Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

423
Visualizações
Spring Session with JDBC - how do I specify the schema for the session tables

I am using Spring Session with Postgres to store user sessions for a spring boot app. Spring Session is looking for the spring_session and spring_session_attributes tables in the public schema. Is there a way to tell Spring Session to look for the session tables in a schema other than public? spring.jpa.properties.hibernate.default_schema in application.properties seems to have no affect on this.

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I managed to solve the problem by specifying the schema in the connect string/datasource URL as follows (also as described in an answer here):

spring.datasource.url=jdbc:postgresql://localhost:9999/db_name?currentSchema=<schema_name>

Still not sure why the spring.session.jdbc.schema property in application.properties has no affect on the schema used by spring session...

about 4 years ago · Santiago Trujillo Relatório

0

Actually the parameter spring.session.jdbc.schema does not means the "database schema", but the SQL schema (the SQL that defines the data structure where the session data is stored).

The schemas for different DBs are available at:

https://github.com/spring-projects/spring-session/tree/master/spring-session-jdbc/src/main/resources/org/springframework/session/jdbc

about 4 years ago · Santiago Trujillo Relatório

0

You can set the table name to be used by Spring Session in your application.properties like this:

spring.session.jdbc.table-name = MY_SCHEMA.SPRING_SESSION

As a result the SQL queries issued by Spring Session will go against the tables of your specified schema. See also org.springframework.session.jdbc.JdbcOperationsSessionRepository.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda