implemented brute force counter measure
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.core;
|
||||
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -8,7 +10,7 @@ import java.util.HashMap;
|
||||
import org.sqlite.SQLiteDataSource;
|
||||
|
||||
public class ConnectionProvider {
|
||||
|
||||
private static final System.Logger LOG = System.getLogger(ConnectionProvider.class.getSimpleName());
|
||||
private static final HashMap<File, Connection> connections = new HashMap<>();
|
||||
|
||||
private ConnectionProvider(){}
|
||||
@@ -17,7 +19,10 @@ public class ConnectionProvider {
|
||||
if (o instanceof String filename) o = new File(filename);
|
||||
if (o instanceof File dbFile) try {
|
||||
var conn = connections.get(dbFile);
|
||||
if (conn == null) connections.put(dbFile, conn = open(dbFile));
|
||||
if (conn == null) {
|
||||
connections.put(dbFile, conn = open(dbFile));
|
||||
LOG.log(INFO,"Using {0}",dbFile);
|
||||
}
|
||||
return conn;
|
||||
} catch (SQLException sqle) {
|
||||
throw new RuntimeException(sqle);
|
||||
|
||||
Reference in New Issue
Block a user