Strabon

changeset 920:167bc144ef2f

fixed a bug in StoreOp that in case of a NullPointer exception the connection was not shut down and also the "locked" table was not deleted
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Mar 25 00:15:39 2013 +0200 (2013-03-25)
parents 6c8b5e31d7fe
children 7c0cc3f1e8b5
files evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java
line diff
     1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java	Mon Mar 25 00:04:09 2013 +0200
     1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java	Mon Mar 25 00:15:39 2013 +0200
     1.3 @@ -80,8 +80,8 @@
     1.4  	 * @param literalValue
     1.5  	 */
     1.6  	private void parsestRDFWKT(String literalValue) {
     1.7 -		if (wkt.trim().length() == 0) {
     1.8 -			wkt = EMPTY_GEOM;
     1.9 +		if (literalValue.trim().length() == 0) {
    1.10 +			literalValue = EMPTY_GEOM;
    1.11  		}
    1.12  		
    1.13  		// we already have this case in {@link WKTHelper}
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Mon Mar 25 00:04:09 2013 +0200
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Mon Mar 25 00:15:39 2013 +0200
     2.3 @@ -171,23 +171,30 @@
     2.4  
     2.5  		try {
     2.6  			con1.commit();
     2.7 -			con1.close();
     2.8 -			repo1.shutDown();
     2.9 -			
    2.10 -			// delete the lock as well
    2.11 -			checkAndDeleteLock(databaseName, user, password, port, serverName);
    2.12  			
    2.13  		} catch (RepositoryException e) {
    2.14  			logger.error("[Strabon.close]", e);
    2.15  			
    2.16 -		} catch (SQLException e) {
    2.17 -			logger.error("[Strabon.close] Error in deleting lock", e);
    2.18 +		} finally {
    2.19 +			try {
    2.20 +				con1.close();
    2.21 +				repo1.shutDown();
    2.22 +				
    2.23 +				// delete the lock as well
    2.24 +				checkAndDeleteLock(databaseName, user, password, port, serverName);
    2.25 +				
    2.26 +			} catch (RepositoryException e) {
    2.27 +				logger.error("[Strabon.close]", e);
    2.28 +				
    2.29 +			}catch (SQLException e) {
    2.30 +				logger.error("[Strabon.close] Error in deleting lock", e);
    2.31 +				
    2.32 +			} catch (ClassNotFoundException e) {
    2.33 +				logger.error("[Strabon.close] Error in deleting lock", e);
    2.34 +			}
    2.35  			
    2.36 -		} catch (ClassNotFoundException e) {
    2.37 -			logger.error("[Strabon.close] Error in deleting lock", e);
    2.38 +			logger.info("[Strabon.close] Connection closed.");
    2.39  		}
    2.40 -
    2.41 -		logger.info("[Strabon.close] Connection closed.");
    2.42  	}
    2.43  
    2.44  	public Object query(String queryString, OutputStream out)