-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Make an explicit section on Hibernate ORM in production with the different defaults #5463
Comments
Use %prod.quarkus.hibernate-orm.sql-load-script=import.sql if you really want import.sql to be used in production and thus in java -jar or native. See https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_quarkus.hibernate-orm.sql-load-script |
@emmanuelbernard don't rush it please - @fmarchioni mentioned it's working differently in JVM mode, that's not expected. @fmarchioni please confirm it's different when running in JVM / production? Or did you only compare /dev mode? |
Note that in my demos, what I described worked as expected with 0.28.1 aka 1.0.0.CR1 |
@emmanuelbernard @Sanne |
Thanks @fmarchioni . This is actually mentioned in the docs - I guess you were expecting it in a different location? Please point me to were you'd have expected to see such a note. |
It is documented twice in https://quarkus.io/guides/hibernate-orm Once here https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_quarkus.hibernate-orm.sql-load-script (unroll the property description) Do you think we need more @fmarchioni ? |
Pardon that's almost a nit-picky, however there is no "Hibernate ORM in
Production mode" so maybe the following Information box might be enriched
with a couple of more words:
- By default, Hibernate ORM, upon boot, will read and execute the SQL
statements in the /import.sql file (if present). You can change the file
name by changing the property quarkus.hibernate-orm.sql-load-script in
application.properties.
+ By default, Hibernate ORM, upon boot, will read and execute the SQL
statements in the /import.sql file (if present). You can change the file
name by changing the property quarkus.hibernate-orm.sql-load-script in
application.properties. Note that when moving to production, you have to
set this property explicitly as you can read from here
<https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_quarkus.hibernate-orm.sql-load-script>.
Il giorno gio 14 nov 2019 alle ore 11:17 Emmanuel Bernard <
notifications@github.com> ha scritto:
… It is documented twice in https://quarkus.io/guides/hibernate-orm
Once here
https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_quarkus.hibernate-orm.sql-load-script
(unroll the property description)
And once here
https://quarkus.io/guides/hibernate-orm#hibernate-orm-in-development-mode
Do you think we need more @fmarchioni <https://github.com/fmarchioni> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5463?email_source=notifications&email_token=AAKBNDJM57XVNQMCEEOJCD3QTUQU7A5CNFSM4JNIM2GKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEBKKDY#issuecomment-553821455>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKBNDMICGCRD45QVARNCB3QTUQU7ANCNFSM4JNIM2GA>
.
|
Fixed by #5469 |
The default import.sql file is not executed when running in Native mode. According to the docs, Hibernate ORM, upon boot, will read and execute the SQL statements in the /import.sql file (if present).
That works in JVM Mode. In native mode the script is not executed. As workaround, you have to set explicitly the property:
quarkus.hibernate-orm.sql-load-script=import.sql
I have used this project to reproduce the issue: https://bit.ly/32Iw7Zh
Environment:
Quarkus 1.0.0.CR1
$ uname -a
Linux fedora 4.18.16-300.fc29.x86_64 #1 SMP Sat Oct 20 23:24:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
GraalVM: graalvm-ce-19.2.0
$GRAALVM_HOME/bin/java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-20190711120915.buildslave.jdk8u-src-tar--b08)
OpenJDK 64-Bit GraalVM CE 19.2.0 (build 25.222-b08-jvmci-19.2-b02, mixed mode)
The text was updated successfully, but these errors were encountered: