Skip to content

Commit

Permalink
Merge pull request #48 from PhilippSalvisberg/develop
Browse files Browse the repository at this point in the history
Fixes issue #47 - Connections of unshared worksheets are not closed
  • Loading branch information
PhilippSalvisberg authored Oct 28, 2018
2 parents 1b14205 + fee82e5 commit 712c9e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sqldev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- The Basics -->
<groupId>org.utplsql</groupId>
<artifactId>org.utplsql.sqldev</artifactId>
<version>0.6.3</version>
<version>0.6.4</version>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ class UtplsqlWorksheet {

private def setConnection(String connectionName) {
if (connectionName !== null && preferences.unsharedWorksheet) {
this.connectionName = Connections.instance.createPrivateConnection(connectionName)
// fix for issue #47 - private connections are not closed in SQLDev >= 17.4.0
try {
// temporary connection is closed when worksheet is closed, but requires SQLDev >= 17.4.0
this.connectionName = Connections.instance.createTemporaryConnection(connectionName)
} catch (Throwable e) {
// private connection is closed when worksheet is closed in SQLDev < 17.4.0
this.connectionName = Connections.instance.createPrivateConnection(connectionName)
}
} else {
this.connectionName = connectionName;
}
Expand Down

0 comments on commit 712c9e7

Please sign in to comment.