Force Hibernate to use user-defined Dialect with Spring boot autoconfiguration
up vote
0
down vote
favorite
I try to deploy a Spring boot app that use a MariaDB database with autoconfiguration to the a Cloud foundry platform, my app work as expected in Pivotal CFY, but when i deploy it to an on-premise CFY plateform i have an error related to Hibernate Dialect.
INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
....
Caused by: java.sql.SQLSyntaxErrorException: (conn=1279230) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'type=MyISAM' at line 1
i want to exclude spring boot autoconfiguration for Hibernate dialect to use the user-defined one.
i specified my dialect and jpa properties in application.properties with :
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
and in hibernate.properties
hibernate.dialect = org.hibernate.dialect.MariaDB10Dialect
But when i run my app i see in logs that spring autoconfiguration overide the Dialect that i specified.
2018-11-07T11:17:05.57+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:05.577 INFO 13 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MariaDB10Dialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=org.mariadb.jdbc.Driver}
2018-11-07T11:17:06.37+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:06.368 INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
hibernate spring-boot mariadb cloudfoundry dialect
add a comment |
up vote
0
down vote
favorite
I try to deploy a Spring boot app that use a MariaDB database with autoconfiguration to the a Cloud foundry platform, my app work as expected in Pivotal CFY, but when i deploy it to an on-premise CFY plateform i have an error related to Hibernate Dialect.
INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
....
Caused by: java.sql.SQLSyntaxErrorException: (conn=1279230) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'type=MyISAM' at line 1
i want to exclude spring boot autoconfiguration for Hibernate dialect to use the user-defined one.
i specified my dialect and jpa properties in application.properties with :
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
and in hibernate.properties
hibernate.dialect = org.hibernate.dialect.MariaDB10Dialect
But when i run my app i see in logs that spring autoconfiguration overide the Dialect that i specified.
2018-11-07T11:17:05.57+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:05.577 INFO 13 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MariaDB10Dialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=org.mariadb.jdbc.Driver}
2018-11-07T11:17:06.37+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:06.368 INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
hibernate spring-boot mariadb cloudfoundry dialect
Show all yourspring.jpa
properties.
– M. Deinum
Nov 7 at 11:02
Please don't add that as comments, edit your question instead.
– M. Deinum
Nov 7 at 11:44
@M.Deinum, done
– Kenovo
Nov 7 at 13:13
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I try to deploy a Spring boot app that use a MariaDB database with autoconfiguration to the a Cloud foundry platform, my app work as expected in Pivotal CFY, but when i deploy it to an on-premise CFY plateform i have an error related to Hibernate Dialect.
INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
....
Caused by: java.sql.SQLSyntaxErrorException: (conn=1279230) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'type=MyISAM' at line 1
i want to exclude spring boot autoconfiguration for Hibernate dialect to use the user-defined one.
i specified my dialect and jpa properties in application.properties with :
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
and in hibernate.properties
hibernate.dialect = org.hibernate.dialect.MariaDB10Dialect
But when i run my app i see in logs that spring autoconfiguration overide the Dialect that i specified.
2018-11-07T11:17:05.57+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:05.577 INFO 13 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MariaDB10Dialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=org.mariadb.jdbc.Driver}
2018-11-07T11:17:06.37+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:06.368 INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
hibernate spring-boot mariadb cloudfoundry dialect
I try to deploy a Spring boot app that use a MariaDB database with autoconfiguration to the a Cloud foundry platform, my app work as expected in Pivotal CFY, but when i deploy it to an on-premise CFY plateform i have an error related to Hibernate Dialect.
INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
....
Caused by: java.sql.SQLSyntaxErrorException: (conn=1279230) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'type=MyISAM' at line 1
i want to exclude spring boot autoconfiguration for Hibernate dialect to use the user-defined one.
i specified my dialect and jpa properties in application.properties with :
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
and in hibernate.properties
hibernate.dialect = org.hibernate.dialect.MariaDB10Dialect
But when i run my app i see in logs that spring autoconfiguration overide the Dialect that i specified.
2018-11-07T11:17:05.57+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:05.577 INFO 13 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MariaDB10Dialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=org.mariadb.jdbc.Driver}
2018-11-07T11:17:06.37+0100 [APP/PROC/WEB/0] OUT 2018-11-07 10:17:06.368 INFO 13 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
hibernate spring-boot mariadb cloudfoundry dialect
hibernate spring-boot mariadb cloudfoundry dialect
edited Nov 7 at 13:12
asked Nov 7 at 10:38
Kenovo
552
552
Show all yourspring.jpa
properties.
– M. Deinum
Nov 7 at 11:02
Please don't add that as comments, edit your question instead.
– M. Deinum
Nov 7 at 11:44
@M.Deinum, done
– Kenovo
Nov 7 at 13:13
add a comment |
Show all yourspring.jpa
properties.
– M. Deinum
Nov 7 at 11:02
Please don't add that as comments, edit your question instead.
– M. Deinum
Nov 7 at 11:44
@M.Deinum, done
– Kenovo
Nov 7 at 13:13
Show all your
spring.jpa
properties.– M. Deinum
Nov 7 at 11:02
Show all your
spring.jpa
properties.– M. Deinum
Nov 7 at 11:02
Please don't add that as comments, edit your question instead.
– M. Deinum
Nov 7 at 11:44
Please don't add that as comments, edit your question instead.
– M. Deinum
Nov 7 at 11:44
@M.Deinum, done
– Kenovo
Nov 7 at 13:13
@M.Deinum, done
– Kenovo
Nov 7 at 13:13
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187781%2fforce-hibernate-to-use-user-defined-dialect-with-spring-boot-autoconfiguration%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Show all your
spring.jpa
properties.– M. Deinum
Nov 7 at 11:02
Please don't add that as comments, edit your question instead.
– M. Deinum
Nov 7 at 11:44
@M.Deinum, done
– Kenovo
Nov 7 at 13:13