Skip to content

Commit

Permalink
Enabled Hibernate stat and sql parameter binding
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed Abdullah committed Oct 23, 2024
1 parent 1346aaa commit 91b0369
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/resources/application-postgresdb.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ spring.datasource.url=jdbc:tc:pgvector/pgvector:pg16:///ecommerce
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=none
spring.sql.init.data-locations=classpath:postgresdb-schema-with-data.sql

# Turn on statistics
spring.jpa.properties.hibernate.generate_statistics=true
logging.level.org.hibernate.stat=debug

# Show all queries
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.show_sql=true
# Don't enable formatting on PROD
spring.jpa.properties.hibernate.format_sql=true

#Show parameters of SQL
logging.level.org.hibernate.orm.jdbc.bind=trace
logging.level.org.hibernate.type=debug


## Disable liquibase as it contains MySQL schema files
spring.liquibase.enabled=false
13 changes: 13 additions & 0 deletions src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ spring.datasource.url=jdbc:tc:mysql:latest:///ecommerce
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=none
spring.sql.init.data-locations=classpath:test-dataset.sql


# Turn on statistics
spring.jpa.properties.hibernate.generate_statistics=true
logging.level.org.hibernate.stat=debug

# Show all queries
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.show_sql=true
# Don't enable formatting on PROD
spring.jpa.properties.hibernate.format_sql=true

#Show parameters of SQL
logging.level.org.hibernate.orm.jdbc.bind=trace
logging.level.org.hibernate.type=debug

spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.maxLifetime=1800000
Expand Down

0 comments on commit 91b0369

Please sign in to comment.