Skip to content

Commit

Permalink
Exposed database connection options conn.max, conn.idle.max, conn.idl…
Browse files Browse the repository at this point in the history
…e.min
  • Loading branch information
hylkevds committed Jun 4, 2018
1 parent 497dc9e commit dd0f8bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Expand Up @@ -2,9 +2,15 @@
# Release Version 1.7
Version 1.7 is not released yet.

**New Features**
* Observation.result can be explicitly set to null. This is useful in cases where
an observation did not produce a value, but the fact that an observation was attempted
must still be recorded.
* Exposed database connection options `persistence.db.conn.max`, `persistence.db.conn.idle.max`, `persistence.db.conn.idle.min`

**Bugfixes**
Fixed #53: Query parser not Unicode aware.
Fixed #52: Generating FeatureOfInterest did not work for Things with multiple Location entities when some of these entities were not geoJSON.
* Fixed #53: Query parser not Unicode aware.
* Fixed #52: Generating FeatureOfInterest did not work for Things with multiple Location entities when some of these entities were not geoJSON.


# Release Version 1.6
Expand Down
Expand Up @@ -51,7 +51,8 @@ public interface PostgresPersistenceManager {
public static final String TAG_DB_USERNAME = "db.username";
public static final String TAG_DB_PASSWORD = "db.password";
public static final String TAG_DB_MAXCONN = "db.conn.max";
public static final String TAG_DB_MAXIDLE = "db.conn.idle";
public static final String TAG_DB_MAXIDLE = "db.conn.idle.max";
public static final String TAG_DB_MINIDLE = "db.conn.idle.min";

public static final DateTime DATETIME_MAX = DateTime.parse("9999-12-31T23:59:59.999Z");
public static final DateTime DATETIME_MIN = DateTime.parse("-4000-01-01T00:00:00.000Z");
Expand Down Expand Up @@ -109,6 +110,7 @@ static ConnectionSource setupBasicDataSource(Settings settings) {
ds.setPassword(settings.get(TAG_DB_PASSWORD));
ds.setMaxIdle(settings.getInt(TAG_DB_MAXIDLE, ds.getMaxIdle()));
ds.setMaxTotal(settings.getInt(TAG_DB_MAXCONN, ds.getMaxTotal()));
ds.setMinIdle(settings.getInt(TAG_DB_MINIDLE, ds.getMinIdle()));
return new ConnectionSourceBasicDataSource(ds);
} catch (ClassNotFoundException exc) {
LOGGER.error("Failed to set up a Connection pool for the database.", exc);
Expand Down
3 changes: 3 additions & 0 deletions docs/settings.adoc
Expand Up @@ -71,6 +71,9 @@ persistence.db.driver:: The Database driver to use when not using JNDI. For Post
persistence.db.url:: The database connection url when not using JNDI. Example: `jdbc:postgresql://localhost:5432/sensorthings`
persistence.db.username:: The username to use when connecting to the database when not using JNDI.
persistence.db.password:: The password to use when connecting to the database when not using JNDI.
persistence.db.conn.max:: The maximum number of database connections to use, when not using JNDI.
persistence.db.conn.idle.max:: The maximum number of idle database connections to keep open, when not using JNDI.
persistence.db.conn.idle.min:: The minimum number of idle database connections to keep open, when not using JNDI.

=== message bus settings

Expand Down

0 comments on commit dd0f8bb

Please sign in to comment.