hapi-fhir-jpaserver-starter icon indicating copy to clipboard operation
hapi-fhir-jpaserver-starter copied to clipboard

Support MariaDB compliant with Apache 2.0 license

Open carloscaverobarca opened this issue 5 years ago • 9 comments

Feature Request

Describe the Feature Request

Support MariaDB compliant with Apache 2.0. MySQL connector has a different commercial use and it cannot be used freely.

Is your feature request related to a problem? Please describe

Cover DB connectors compliant with Apache 2.0 would spread the use of the component.

Describe Preferred Solution

Add the MariaDB connector to the maven pom. Modify the configuration of the server and provide a docker-compose for testing.

Additional Context

MariaDB client is available here and the docker image here

carloscaverobarca avatar Mar 10 '20 17:03 carloscaverobarca

I can send you a PR with the proposed solution

carloscaverobarca avatar Mar 10 '20 17:03 carloscaverobarca

Sounds great, PR would be welcomed.

On Tue, Mar 10, 2020 at 1:07 PM Carlos Cavero [email protected] wrote:

I can send you a PR with the proposed solution

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/86?email_source=notifications&email_token=AA2N7HIFBKYFD42EWTSJDM3RGZXWBA5CNFSM4LFDWD22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOMJNLI#issuecomment-597202605, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2N7HJDWZ3WR27R7NF3543RGZXWBANCNFSM4LFDWD2Q .

jamesagnew avatar Mar 10 '20 17:03 jamesagnew

Ok, I am working on it, hope to send this week

carloscaverobarca avatar Mar 10 '20 17:03 carloscaverobarca

I found some issues with the creation of sequences, HAPI starts and load the resources well but in MariaDB the SEQUENCES are created as TABLES, so when I search for the resouces error SEQ_SEARCH is not a SEQUENCE is raised (I supposed a lot of functionalities will also stop working for the same reason). Of course everything works if I remove the tables SEQ_XX and create the sequences manually, but it is not the ideal solution. @jamesagnew any hint that can help regarding the database creation I can have a look to understand why sequences are created as tables in MariaDB? Thanks!

carloscaverobarca avatar Mar 10 '20 21:03 carloscaverobarca

Is it possible we just need a newer/different dialect configured in hibernate?

Older MySQL didn't support native sequences, so MariaDB probably didn't either..

On Tue, Mar 10, 2020 at 5:19 PM Carlos Cavero [email protected] wrote:

I found some issues with the creation of sequences, HAPI starts and load the resources well but in MariaDB the SEQUENCES are created as TABLES, so when I search for the resouces error SEQ_SEARCH is not a SEQUENCE is raised (I supposed a lot of functionalities will also stop working for the same reason). Of course everything works if I remove the tables SEQ_XX and create the sequences manually, but it is not the ideal solution. @jamesagnew https://github.com/jamesagnew any hint that can help regarding the database creation I can have a look to understand why sequences are created as tables in MariaDB? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/86?email_source=notifications&email_token=AA2N7HPXRCEGW5JA24BKAELRG2VHJA5CNFSM4LFDWD22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONG3EQ#issuecomment-597323154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2N7HKKBW6SDVY4GJ74E5TRG2VHJANCNFSM4LFDWD2Q .

jamesagnew avatar Mar 10 '20 21:03 jamesagnew

Yes I considered this but I am using org.hibernate.dialect.MariaDB103Dialect and MariaDB 10.3 supports sequences. But probably you are right there are something missing in this direction. I will have a look and tell you something.

carloscaverobarca avatar Mar 10 '20 21:03 carloscaverobarca

Ok, now it is working, the problem is that when I firstly created the database schema, I used the MySQL dialect and something went wrong with MariaDB. I will upload a bunch of resources to test and send the PR. It seems everything is working like in MySQL (as expected).

carloscaverobarca avatar Mar 10 '20 22:03 carloscaverobarca

I loaded resources to the R4 instance and everything works as expected. I sent a PR, tell me if you need more clarifications/refinements.

carloscaverobarca avatar Mar 11 '20 07:03 carloscaverobarca

Hi @carloscaverobarca - Would you consider rebasing your changes in order for us to have a look at your PR on https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/87?

jkiddo avatar Jun 27 '21 07:06 jkiddo

Closing as inactive

jkiddo avatar Apr 17 '24 16:04 jkiddo