Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void loadSqlgSchema() {
String version = getBuildVersion();
String oldVersion = createOrUpdateGraph(version);
int versionAsInt = Integer.parseInt(oldVersion.replace("-SNAPSHOT", "").replace(".", ""));
LOGGER.debug(String.format("loadSqlgSchema() version=%s, oldVersion=%s, versionAsInt=%s", version, oldVersion, versionAsInt));
if (versionAsInt < 203) {
//Need to check if there are any timestampz or timetz columns.
//If so throw an exception as the user needs to alter them to drop the 'z'
Expand Down Expand Up @@ -164,6 +165,7 @@ private void updateTopology(String oldVersion) {
if (oldVersion != null) {
v = VersionUtil.parseVersion(oldVersion, null, null);
}
LOGGER.debug(String.format("updateTopology() v=%s",v));
if (v.isUnknownVersion() || v.compareTo(new Version(1, 5, 0, null, null, null)) < 0) {
if (this.sqlDialect.supportsDeferrableForeignKey()) {
upgradeForeignKeysToDeferrable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3490,7 +3490,16 @@ public void run() {
Properties props = new Properties();
props.setProperty("user", sqlgGraph.configuration().getString("jdbc.username"));
props.setProperty("password", sqlgGraph.configuration().getString("jdbc.password"));
Connection connection = DriverManager.getConnection(jdbcUrl, props);
Connection connection = null;
try {
connection = DriverManager.getConnection(jdbcUrl, props);
} catch (SQLException e) {
logger.debug("jdbcUrl={}", jdbcUrl);
logger.debug("user={}, password.isEmpty={}", props.getProperty("user"), props.getProperty("password").isEmpty());
logger.error("failed to open standard jdbc connection, log exception, and instead use pool connection", e);
// https://github.com/pietermartin/sqlg/issues/488
connection = this.sqlgGraph.tx().getConnection();
}
connection.setAutoCommit(false);
while (run.get()) {
PGConnection pgConnection = connection.unwrap(org.postgresql.PGConnection.class);
Expand Down