Skip to content
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

FINERACT-982 - Completely ditch use of Drizzle JDBC Driver #1366

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ Our `ClasspathHellDuplicatesCheckRuleTest` detects classes that appear in more t
Releasing
---------

PRE-RELEASE NOTICE: Please before starting any release process, ensure that the you have replaced mysql connector package from mariadb connector/j back to drizzle driver. Files requiring changes are:
* docker-compose.yml
* fineract-provider/build.gradle
* fineract-provider/src/main/resources/META-INF/spring/jdbc.properties
* kubernetes/fineract-server-deployment.yml

Comment on lines +384 to +389
Copy link
Member

Choose a reason for hiding this comment

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

Nah, this will be super confusing... we cannot (should not) have the release be anything different than what we work with during development. Let's figure out a way to avoid this. My proposal is that we simply do not ship any JDBD driver in the Fineract distribution at all, ever.

Instead, why don't we just include a 2-3 lines trivial small fineract.sh script illustrating how to launch java ... with both fineract.jar and mariadb-java-client-2.7.0.jar on the CP? And document that in https://github.com/apache/fineract#instructions-to-build-the-jar-file as well (and also a word about having to add it to Tomcat when using the WAR), as part of this PR. And then we could entirely remove this section for "special instructions" for Releasing. WDYT?

As for actually getting the mariadb-java-client-2.7.0.jar, it must be available somewhere under .gradle/ or so? I'm not just where you can find it... or we could just wget (or curl - whatever) the MariaDB Connector/J?

[How to Release Apache Fineract](https://cwiki.apache.org/confluence/x/DRwIB) documents the process how we make the source code that is available here in this Git repository into a binary release tar.gz available on http://fineract.apache.org.

Before you use Gradle to create a release you need to make sure that you provide the proper GPG parameters. You have to options:
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ services:
depends_on:
- fineractmysql
environment:
- DRIVERCLASS_NAME=org.drizzle.jdbc.DrizzleDriver
- DRIVERCLASS_NAME=org.mariadb.jdbc.Driver
- PROTOCOL=jdbc
- SUB_PROTOCOL=mysql:thin
- fineract_tenants_driver=org.drizzle.jdbc.DrizzleDriver
- fineract_tenants_url=jdbc:mysql:thin://fineractmysql:3306/fineract_tenants
- SUB_PROTOCOL=mysql
- fineract_tenants_driver=org.mariadb.jdbc.Driver
- fineract_tenants_url=jdbc:mysql://fineractmysql:3306/fineract_tenants
- fineract_tenants_uid=root
- fineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca
- FINERACT_DEFAULT_TENANTDB_HOSTNAME=fineractmysql
Expand Down
13 changes: 7 additions & 6 deletions fineract-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -276,37 +276,38 @@ import groovy.sql.Sql

project.ext.mysqlUser='root'
project.ext.mysqlPassword='mysql'
project.ext.driver='org.mariadb.jdbc.Driver'

configurations {
driver
connector
}
dependencies {
driver 'org.drizzle.jdbc:drizzle-jdbc:1.4'
connector "${mysqlConnector}:${mysqlConnectorVersion}"
}

URLClassLoader loader = GroovyObject.class.classLoader
configurations.driver.each {File file ->
configurations.connector.each {File file ->
loader.addURL(file.toURL())
}

task createDB {
description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
def sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, driver )
sql.execute( 'create database '+"`$dbName`" )
}
}

task dropDB {
description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
def sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, driver )
sql.execute( 'DROP DATABASE '+"`$dbName`")
}
}
task setBlankPassword {
doLast {
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
def sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, driver )
sql.execute('USE `fineract_tenants`')
sql.execute('UPDATE fineract_tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
}
Expand Down
1 change: 0 additions & 1 deletion fineract-provider/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ dependencies {
'org.apache.poi:poi-ooxml-schemas',
'org.apache.tika:tika-core',

'org.drizzle.jdbc:drizzle-jdbc',
'org.flywaydb:flyway-core',

'com.github.librepdf:openpdf',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# under the License.
#

DRIVERCLASS_NAME:org.drizzle.jdbc.DrizzleDriver
DRIVERCLASS_NAME:org.mariadb.jdbc.Driver
PROTOCOL:jdbc
SUB_PROTOCOL:mysql:thin
SUB_PROTOCOL:mysql

fineract_tenants_driver:org.drizzle.jdbc.DrizzleDriver
fineract_tenants_url:jdbc:mysql:thin://localhost:3306/fineract_tenants
fineract_tenants_driver:org.mariadb.jdbc.Driver
fineract_tenants_url:jdbc:mysql://localhost:3306/fineract_tenants
fineract_tenants_uid:root
fineract_tenants_pwd:mysql
8 changes: 4 additions & 4 deletions kubernetes/fineract-server-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ spec:
image: apache/fineract:latest
env:
- name: DRIVERCLASS_NAME
value: org.drizzle.jdbc.DrizzleDriver
value: org.mariadb.jdbc.Driver
- name: PROTOCOL
value: jdbc
- name: SUB_PROTOCOL
value: mysql:thin
value: mysql
- name: fineract_tenants_driver
value: org.drizzle.jdbc.DrizzleDriver
value: org.mariadb.jdbc.Driver
- name: fineract_tenants_url
value: jdbc:mysql:thin://fineractmysql:3306/fineract_tenants
value: jdbc:mysql://fineractmysql:3306/fineract_tenants
- name: fineract_tenants_uid
valueFrom:
secretKeyRef:
Expand Down