-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #57: upgrade jchem to version 17.24.1
- Loading branch information
Showing
6 changed files
with
188 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CHEMAXON_USERNAME=<username> | ||
CHEMAXON_PASSWORD=<api key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<servers> | ||
<server> | ||
<username>${CHEMAXON_USERNAME}</username> | ||
<password>${CHEMAXON_PASSWORD}</password> | ||
<id>central</id> | ||
</server> | ||
<server> | ||
<username>${CHEMAXON_USERNAME}</username> | ||
<password>${CHEMAXON_PASSWORD}</password> | ||
<id>snapshots</id> | ||
</server> | ||
</servers> | ||
<profiles> | ||
<profile> | ||
<repositories> | ||
<repository> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
<id>central</id> | ||
<name>libs-release</name> | ||
<url>https://hub.chemaxon.com/artifactory/libs-release</url> | ||
</repository> | ||
<repository> | ||
<snapshots /> | ||
<id>snapshots</id> | ||
<name>libs-snapshot</name> | ||
<url>https://hub.chemaxon.com/artifactory/libs-snapshot</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
<id>apache</id> | ||
<name>repo.maven.apache.org</name> | ||
<url>https://repo.maven.apache.org/maven2</url> | ||
</pluginRepository> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
<id>central</id> | ||
<name>plugins-release</name> | ||
<url>https://hub.chemaxon.com/artifactory/plugins-release</url> | ||
</pluginRepository> | ||
<pluginRepository> | ||
<snapshots /> | ||
<id>snapshots</id> | ||
<name>plugins-release</name> | ||
<url>https://hub.chemaxon.com/artifactory/plugins-release</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<id>artifactory</id> | ||
</profile> | ||
</profiles> | ||
<activeProfiles> | ||
<activeProfile>artifactory</activeProfile> | ||
</activeProfiles> | ||
</settings> |
55 changes: 55 additions & 0 deletions
55
...java/com/labsynch/cmpdreg/db/migration/postgres/jchem/V1_2_2_2__Upgrade_Jchem_Tables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.labsynch.cmpdreg.db.migration.postgres.jchem; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
import org.flywaydb.core.api.migration.jdbc.JdbcMigration; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import chemaxon.jchem.db.UpdateHandlerException; | ||
import chemaxon.jchem.db.Updater; | ||
import chemaxon.util.ConnectionHandler; | ||
|
||
public class V1_2_2_2__Upgrade_Jchem_Tables implements JdbcMigration { | ||
|
||
Logger logger = LoggerFactory.getLogger(V1_2_2_2__Upgrade_Jchem_Tables.class); | ||
|
||
|
||
public void migrate(Connection conn) throws Exception { | ||
logger.info("ATTEMPTING TO UPGRADE JCHEM TABLES"); | ||
conn.setAutoCommit(true); | ||
logger.info("connection autocommit mode: " + conn.getAutoCommit()); | ||
logger.info("getTransactionIsolation " + conn.getTransactionIsolation()); | ||
|
||
recalculateJChemTable(conn); | ||
|
||
conn.setAutoCommit(false); | ||
logger.info("connection autocommit mode: " + conn.getAutoCommit()); | ||
|
||
} | ||
|
||
private boolean recalculateJChemTable(Connection conn) throws UpdateHandlerException, SQLException { | ||
ConnectionHandler ch = new ConnectionHandler(); | ||
ch.setConnection(conn); | ||
|
||
String message = ""; | ||
Updater ud = new Updater(ch); | ||
Updater.UpdateInfo ui = null; | ||
while ((ui = ud.getNextUpdateInfo()) != null) { | ||
logger.info("\n" + ui.processingMessage + "\n"); | ||
logger.info("Is structure change required: " + ui.isStructuralChange); | ||
message = ud.performCurrentUpdate(); | ||
logger.info(message); | ||
} | ||
|
||
logger.info("updated the Jchem structure tables " ); | ||
|
||
return false; | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
|
55 changes: 55 additions & 0 deletions
55
...ava/com/labsynch/cmpdreg/db/migration/sqlserver/jchem/V1_0_4_4__Upgrade_Jchem_Tables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.labsynch.cmpdreg.db.migration.sqlserver.jchem; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
import org.flywaydb.core.api.migration.jdbc.JdbcMigration; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import chemaxon.jchem.db.UpdateHandlerException; | ||
import chemaxon.jchem.db.Updater; | ||
import chemaxon.util.ConnectionHandler; | ||
|
||
public class V1_0_4_4__Upgrade_Jchem_Tables implements JdbcMigration { | ||
|
||
Logger logger = LoggerFactory.getLogger(V1_0_4_4__Upgrade_Jchem_Tables.class); | ||
|
||
|
||
public void migrate(Connection conn) throws Exception { | ||
logger.info("ATTEMPTING TO UPGRADE JCHEM TABLES"); | ||
conn.setAutoCommit(true); | ||
logger.info("connection autocommit mode: " + conn.getAutoCommit()); | ||
logger.info("getTransactionIsolation " + conn.getTransactionIsolation()); | ||
|
||
recalculateJChemTable(conn); | ||
|
||
conn.setAutoCommit(false); | ||
logger.info("connection autocommit mode: " + conn.getAutoCommit()); | ||
|
||
} | ||
|
||
private boolean recalculateJChemTable(Connection conn) throws UpdateHandlerException, SQLException { | ||
ConnectionHandler ch = new ConnectionHandler(); | ||
ch.setConnection(conn); | ||
|
||
String message = ""; | ||
Updater ud = new Updater(ch); | ||
Updater.UpdateInfo ui = null; | ||
while ((ui = ud.getNextUpdateInfo()) != null) { | ||
logger.info("\n" + ui.processingMessage + "\n"); | ||
logger.info("Is structure change required: " + ui.isStructuralChange); | ||
message = ud.performCurrentUpdate(); | ||
logger.info(message); | ||
} | ||
|
||
logger.info("updated the Jchem structure tables " ); | ||
|
||
return false; | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
|