Skip to content

FINERACT-984: PostgreSQL support#2047

Merged
vidakovic merged 1 commit into
apache:developfrom
galovics:FINERACT-984-6
Feb 22, 2022
Merged

FINERACT-984: PostgreSQL support#2047
vidakovic merged 1 commit into
apache:developfrom
galovics:FINERACT-984-6

Conversation

@galovics
Copy link
Copy Markdown
Contributor

Description

Describe the changes made and why they were made.

Ignore if these details are present on the associated Apache Fineract JIRA ticket.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests

  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.

  • Create/update unit or integration tests for verifying the changes made.

  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.

  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/api-docs/apiLive.htm with details of any API changes

  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@galovics galovics changed the title FINERACT-984-6: PostgreSQL support FINERACT-984: PostgreSQL support Feb 22, 2022
@vidakovic vidakovic self-requested a review February 22, 2022 16:22
Copy link
Copy Markdown
Contributor

@vidakovic vidakovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vidakovic vidakovic merged commit 8389106 into apache:develop Feb 22, 2022
@nmogbuk
Copy link
Copy Markdown

nmogbuk commented Mar 2, 2022

Please I am unable to use the PostgreSQL DB for the docker server. Below is a snippet of the error log:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hikariTenantDataSource' defined in class path resource [org/apache/fineract/infrastructure/core/config/HikariCpConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'hikariTenantDataSource' threw exception; nested exception is java.lang.RuntimeException: Driver org.mariadb.jdbc.Driver claims to not accept jdbcUrl, jdbc:postgresql://fineractpostgresql:5432/fineract_tenants

@galovics @vidakovic

@galovics
Copy link
Copy Markdown
Contributor Author

galovics commented Mar 2, 2022

@nmogbuk Seems like you're trying to use the mariadb JDBC driver for the PostgreSQL DB. Could you please tell me how you're trying to start the app?

@vidakovic
Copy link
Copy Markdown
Contributor

vidakovic commented Mar 2, 2022 via email

@nmogbuk
Copy link
Copy Markdown

nmogbuk commented Mar 2, 2022

@nmogbuk Seems like you're trying to use the MariaDB JDBC driver for the PostgreSQL DB. Could you please tell me how you're trying to start the app?

@galovics I am trying to deploy the docker images using Docker Swarm. I built the Fineract server image using the Gradle command: ./gradlew :fineract-provider:jibDockerBuild Below is my .env file:

FINERACT_NODE_ID=1 FINERACT_HIKARI_DRIVER_CLASS_NAME=org.postgresql.Driver FINERACT_HIKARI_JDBC_URL=jdbc:postgresql://fineractpostgresql:5432/fineract_tenants FINERACT_HIKARI_USERNAME=zer0 FINERACT_HIKARI_PASSWORD=skdcnwauicn2ucnaecasdsajdnizucawencascdca FINERACT_HIKARI_MINIMUM_IDLE=3 FINERACT_HIKARI_MAXIMUM_POOL_SIZE=10 FINERACT_HIKARI_IDLE_TIMEOUT=60000 FINERACT_HIKARI_CONNECTION_TIMEOUT=20000 FINERACT_HIKARI_TEST_QUERY=SELECT 1 FINERACT_HIKARI_AUTO_COMMIT=true FINERACT_HIKARI_DS_PROPERTIES_CACHE_PREP_STMTS=true FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SIZE=250 FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SQL_LIMIT=2048 FINERACT_HIKARI_DS_PROPERTIES_USE_SERVER_PREP_STMTS=true FINERACT_HIKARI_DS_PROPERTIES_USE_LOCAL_SESSION_STATE=true FINERACT_HIKARI_DS_PROPERTIES_REWRITE_BATCHED_STATEMENTS=true FINERACT_HIKARI_DS_PROPERTIES_CACHE_RESULT_SET_METADATA=true FINERACT_HIKARI_DS_PROPERTIES_CACHE_SERVER_CONFIGURATION=true FINERACT_HIKARI_DS_PROPERTIES_ELIDE_SET_AUTO_COMMITS=true FINERACT_HIKARI_DS_PROPERTIES_MAINTAIN_TIME_STATS=false FINERACT_HIKARI_DS_PROPERTIES_LOG_SLOW_QUERIES=true FINERACT_HIKARI_DS_PROPERTIES_DUMP_QUERIES_IN_EXCEPTION=true FINERACT_DEFAULT_TENANTDB_HOSTNAME=fineractpostgresql FINERACT_DEFAULT_TENANTDB_PORT=5432 FINERACT_DEFAULT_TENANTDB_UID=zer0 FINERACT_DEFAULT_TENANTDB_PWD=skdcnwauicn2ucnaecasdsajdnizucawencascdca FINERACT_DEFAULT_TENANTDB_CONN_PARAMS= FINERACT_DEFAULT_TENANTDB_TIMEZONE=Africa/Lagos FINERACT_DEFAULT_TENANTDB_IDENTIFIER=default FINERACT_DEFAULT_TENANTDB_NAME=fineract_default FINERACT_DEFAULT_TENANTDB_DESCRIPTION=Kendi

@galovics
Copy link
Copy Markdown
Contributor Author

galovics commented Mar 2, 2022

@nmogbuk I see, probably you have used an older docker-compose file as a base. With the PostgreSQL support, I actually fixed one of the env variables in the docker-compose file, namely the FINERACT_HIKARI_DRIVER_CLASS_NAME env variable should be called FINERACT_HIKARI_DRIVER_SOURCE_CLASS_NAME cause the first one is not picked up by the app.

@nmogbuk
Copy link
Copy Markdown

nmogbuk commented Mar 2, 2022

@galovics Thanks so much for spotting the issue. That fixed it.

@galovics
Copy link
Copy Markdown
Contributor Author

galovics commented Mar 3, 2022

@nmogbuk awesome. Glad it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants