Revision 9295

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/IntializeApplicationExtension.java
12 12
import com.iver.andami.plugins.Extension;
13 13
import com.iver.cit.gvsig.fmap.layers.FLayerFileVectorial;
14 14
import com.iver.cit.gvsig.fmap.layers.FLayerGenericVectorial;
15
import com.iver.cit.gvsig.fmap.layers.LayerFactory;
15 16
import com.iver.utiles.extensionPoints.ExtensionPoint;
16 17
import com.iver.utiles.extensionPoints.ExtensionPoints;
17 18
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
......
100 101
		//if (props.get("os.name").toLowerCase().equals("linux"))
101 102
		return writer.toString();
102 103
	}
103

  
104
	
105
	public void terminate() {
106
		
107
		super.terminate();
108
		try {
109
			LayerFactory.getDataSourceFactory().finalizeThis();
110
		} catch (Exception e) {
111
			//e.printStackTrace();
112
		}
113
		
114
	}
104 115
}
trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/engine/data/DataSourceFactory.java
1791 1791
	 *             If cannot free internal resources
1792 1792
	 * @throws DriverException
1793 1793
	 *             If drivers cannot free remote resources
1794
	 */
1795
	public void finalize() throws SQLException, DriverException {
1796
		finalizeThis();
1797
	}
1798
	
1799
	public void finalizeThis() {
1800
		try {
1801
			clearViews();
1802
		} catch (Exception e) {
1803
			e.printStackTrace();
1804
		}
1794
	 */	
1795
	public void finalizeThis()  throws SQLException, DriverException {
1805 1796
		
1806
		
1807 1797
		try {
1808
			Connection c = java.sql.DriverManager.getConnection(
1809
					"jdbc:hsqldb:file:", "", "");
1798
			clearViews();
1799
		} finally {
1800
			Connection c = null;
1801
			try {
1802
				c = java.sql.DriverManager.getConnection(
1803
						"jdbc:hsqldb:file:", "", "");
1804
			} catch (Exception e) {
1805
				return;
1806
			}
1810 1807
			Statement st = c.createStatement();
1811 1808
			st.execute("SHUTDOWN");
1812 1809
			st.close();
1813 1810
			c.close();
1814
		} catch (Exception e) {
1815
			e.printStackTrace();
1816 1811
		}
1817 1812
		
1818 1813
	}

Also available in: Unified diff