Restore functionality of deprecated SQLite connection acquisition

If the connection is closed, no new SQLite connection is created in plugins still using the
deprecated method.


Introduced in 0ae9c6fcdb
This commit is contained in:
Christian Koop 2022-12-26 13:39:51 +01:00
parent c3fb050444
commit 296f82f50e
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
1 changed files with 1 additions and 9 deletions

View File

@ -42,16 +42,8 @@ public class SQLiteConnector implements DatabaseConnector {
@Deprecated
@Override
public void connect(ConnectionCallback callback) {
if (this.connection == null) {
try {
this.connection = DriverManager.getConnection(this.connectionString);
} catch (SQLException ex) {
this.plugin.getLogger().severe("An error occurred retrieving the SQLite database connection: " + ex.getMessage());
}
}
try {
callback.accept(this.connection);
callback.accept(getConnection());
} catch (Exception ex) {
this.plugin.getLogger().severe("An error occurred executing an SQLite query: " + ex.getMessage());
ex.printStackTrace();