Strabon

changeset 1525:c18b84e14117

some additions for reporting the application name from the postgres connection url (does not work yet)
author Babis Nikolaou <charnik@di.uoa.gr>
date Tue Sep 22 20:56:35 2015 +0300 (2015-09-22)
parents 1f52e999af3e
children ba8fb069b2ca f287cc1b8b99 5d214ccaeb64
files postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlStore.java runtime/src/main/java/eu/earthobservatory/runtime/postgis/Strabon.java
line diff
     1.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlStore.java	Tue Sep 22 20:13:47 2015 +0300
     1.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlStore.java	Tue Sep 22 20:56:35 2015 +0300
     1.3 @@ -104,8 +104,11 @@
     1.4  		url.append(databaseName);
     1.5  		Iterator<Entry<String, String>> iter;
     1.6  		iter = getProperties().entrySet().iterator();
     1.7 +		
     1.8 +		// append application name for identifying connection in `pg_stat_activity' table
     1.9 +		url.append("?application_name=strabon");
    1.10  		if (iter.hasNext()) {
    1.11 -			url.append("?");
    1.12 +			url.append("&");
    1.13  		}
    1.14  		while (iter.hasNext()) {
    1.15  			Entry<String, String> e = iter.next();
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/postgis/Strabon.java	Tue Sep 22 20:13:47 2015 +0300
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/postgis/Strabon.java	Tue Sep 22 20:56:35 2015 +0300
     2.3 @@ -55,7 +55,7 @@
     2.4  			logger.info("[Strabon] Cleaning...");
     2.5  			Class.forName("org.postgresql.Driver");
     2.6  			url = "jdbc:postgresql://" + serverName + ":" + port + "/"
     2.7 -			+ databaseName + "?user=" + user + "&password=" + password + "&application_name=Strabon";
     2.8 +			+ databaseName + "?user=" + user + "&password=" + password + "&application_name=strabon";
     2.9  			Connection conn = DriverManager.getConnection(url);
    2.10  			java.sql.Statement st = conn.createStatement();
    2.11  			st.execute("DROP TABLE IF EXISTS locked;");
    2.12 @@ -95,7 +95,7 @@
    2.13  		try {
    2.14  			logger.info("[Strabon] Checking for locks...");
    2.15  			Class.forName("org.postgresql.Driver");
    2.16 -			url = "jdbc:postgresql://" + serverName + ":" + port + "/" + databaseName + "?user=" + user + "&password=" + password + "&application_name=Strabon";
    2.17 +			url = "jdbc:postgresql://" + serverName + ":" + port + "/" + databaseName + "?user=" + user + "&password=" + password + "&application_name=strabon";
    2.18  			
    2.19  			conn = DriverManager.getConnection(url);
    2.20  			st = conn.createStatement();