Skip to content

Commit

Permalink
Fix DataSource cache when using modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Aug 1, 2024
1 parent 3999722 commit 9658a8e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ private static void init() {
public static DataSource GetDataSource(URI uri, ConnectionMixinFactory.ConnectionMixinOptions options)
throws DataSourceException {
init();
DataSource source = DATA_SOURCE_POOL.get(uri);
URI uriKey = uri;
DataSource source = DATA_SOURCE_POOL.get(uriKey);
if(source != null) {
return source;
}
Expand Down Expand Up @@ -91,7 +92,7 @@ public static DataSource GetDataSource(URI uri, ConnectionMixinFactory.Connectio
if(!ds.getModifiers().contains(DataSource.DataSourceModifier.TRANSIENT)) {
ds.populate();
}
DATA_SOURCE_POOL.put(uri, ds);
DATA_SOURCE_POOL.put(uriKey, ds);
return ds;
} catch (InvocationTargetException | NoSuchMethodException | SecurityException | InstantiationException
| IllegalAccessException | IllegalArgumentException | DataSourceException ex) {
Expand Down

0 comments on commit 9658a8e

Please sign in to comment.