Skip to content

Commit 9658a8e

Browse files
committed
Fix DataSource cache when using modifiers
1 parent 3999722 commit 9658a8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/laytonsmith/persistence/DataSourceFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ private static void init() {
5353
public static DataSource GetDataSource(URI uri, ConnectionMixinFactory.ConnectionMixinOptions options)
5454
throws DataSourceException {
5555
init();
56-
DataSource source = DATA_SOURCE_POOL.get(uri);
56+
URI uriKey = uri;
57+
DataSource source = DATA_SOURCE_POOL.get(uriKey);
5758
if(source != null) {
5859
return source;
5960
}
@@ -91,7 +92,7 @@ public static DataSource GetDataSource(URI uri, ConnectionMixinFactory.Connectio
9192
if(!ds.getModifiers().contains(DataSource.DataSourceModifier.TRANSIENT)) {
9293
ds.populate();
9394
}
94-
DATA_SOURCE_POOL.put(uri, ds);
95+
DATA_SOURCE_POOL.put(uriKey, ds);
9596
return ds;
9697
} catch (InvocationTargetException | NoSuchMethodException | SecurityException | InstantiationException
9798
| IllegalAccessException | IllegalArgumentException | DataSourceException ex) {

0 commit comments

Comments
 (0)