Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix: allow disabling field metadata cache (#1052)
Clients accessing very dynamic schemas can have issues with the field metadata cache getting stale. This change allows configuring the databaseMetadataCacheFields property to 0 to disable the cache and avoid these issues where necessary. This behaviour was already documented, however did not actually work as the codepath assumed it could retrieve the fields from the cache.
- Loading branch information
Showing
with
111 additions
and 10 deletions.
- +1 −1 pgjdbc/src/main/java/org/postgresql/PGProperty.java
- +9 −8 pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSetMetaData.java
- +10 −0 pgjdbc/src/main/java/org/postgresql/util/Gettable.java
- +12 −0 pgjdbc/src/main/java/org/postgresql/util/GettableHashMap.java
- +10 −1 pgjdbc/src/main/java/org/postgresql/util/LruCache.java
- +69 −0 pgjdbc/src/test/java/org/postgresql/test/jdbc2/ResultSetMetaDataTest.java
@@ -0,0 +1,10 @@ | ||
/* | ||
* Copyright (c) 2018, PostgreSQL Global Development Group | ||
* See the LICENSE file in the project root for more information. | ||
*/ | ||
|
||
package org.postgresql.util; | ||
|
||
public interface Gettable<K,V> { | ||
V get(K key); | ||
} |
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2018, PostgreSQL Global Development Group | ||
* See the LICENSE file in the project root for more information. | ||
*/ | ||
|
||
package org.postgresql.util; | ||
|
||
import java.util.HashMap; | ||
|
||
public class GettableHashMap<K,V> extends HashMap<K,V> implements Gettable<K,V> { | ||
|
||
} |