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









share|improve this question
























  • 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















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









share|improve this question
























  • 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













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









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 13:12

























asked Nov 7 at 10:38









Kenovo

552




552












  • 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


















  • 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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini