Revision: 6734
http://sourceforge.net/p/squirrel-sql/code/6734
Author: gerdwagner
Date: 2013-01-11 22:35:59 +0000 (Fri, 11 Jan 2013)
Log Message:
-----------
Logging of Application shutdown:
Sometimes closing SQuirreL can take some time. From looking at the log file
one can find out which shutdown actions take long:
Choose log level: info
Search the log file for: "Application.shutdown"
The first Global preferences tab tells where log and log configuration files are.
Modified Paths:
--------------
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/Application.java
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfoCacheSerializer.java
trunk/sql12/doc/src/main/resources/changes.txt
Modified: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/Application.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/Application.java 2013-01-08 12:23:22 UTC (rev 6733)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/Application.java 2013-01-11 22:35:59 UTC (rev 6734)
@@ -227,27 +227,40 @@
*/
public boolean shutdown(boolean updateLaunchScript)
{
- s_log.info(s_stringMgr.getString("Application.shutdown", Calendar.getInstance().getTime()));
+ long begin = System.currentTimeMillis();
+ s_log.info("Application.shutdown: BEGIN: " + Calendar.getInstance().getTime());
+
updateCheckTimer.stop();
-
- saveApplicationState();
+ s_log.info("Application.shutdown: updateCheckTimer.stop() ELAPSED: " + (System.currentTimeMillis() - begin));
- if (!closeAllSessions()) { return false; }
- _pluginManager.unloadPlugins();
+ _saveApplicationState(begin);
+ s_log.info("Application.shutdown: saveApplicationState() ELAPSED: " + (System.currentTimeMillis() - begin));
+ if (!closeAllSessions())
+ {
+ return false;
+ }
+
+ _pluginManager.unloadPlugins();
+ s_log.info("Application.shutdown: _pluginManager.unloadPlugins() ELAPSED: " + (System.currentTimeMillis() - begin));
+
closeAllViewers();
+ s_log.info("Application.shutdown: closeAllViewers() ELAPSED: " + (System.currentTimeMillis() - begin));
closeOutputStreams();
+ s_log.info("Application.shutdown: closeOutputStreams() ELAPSED: " + (System.currentTimeMillis() - begin));
SchemaInfoCacheSerializer.waitTillStoringIsDone();
-
- if (updateLaunchScript) {
+ s_log.info("Application.shutdown: SchemaInfoCacheSerializer.waitTillStoringIsDone() ELAPSED: " + (System.currentTimeMillis() - begin));
+
+ if (updateLaunchScript)
+ {
updateLaunchScript();
+ s_log.info("Application.shutdown: updateLaunchScript() ELAPSED: " + (System.currentTimeMillis() - begin));
}
- String msg = s_stringMgr.getString("Application.shutdowncomplete", Calendar.getInstance().getTime());
- s_log.info(msg);
+ s_log.info("Application.shutdown END: " + Calendar.getInstance().getTime());
LoggerController.shutdown();
return true;
@@ -258,37 +271,55 @@
*/
public void saveApplicationState()
{
+ _saveApplicationState(null);
+ }
- _prefs.setFirstRun(false);
+ private void _saveApplicationState(Long begin)
+ {
+ if(null == begin)
+ {
+ begin = System.currentTimeMillis();
+ }
- for (ApplicationListener l : _listeners.toArray(new ApplicationListener[0]))
- {
- l.saveApplicationState();
- }
+ _prefs.setFirstRun(false);
+ s_log.info("Application.shutdown->_saveApplicationState: _prefs.setFirstRun(false) ELAPSED: " + (System.currentTimeMillis() - begin));
- saveDrivers();
+ for (ApplicationListener l : _listeners.toArray(new ApplicationListener[0]))
+ {
+ l.saveApplicationState();
+ }
+ s_log.info("Application.shutdown->_saveApplicationState: _listeners ELAPSED: " + (System.currentTimeMillis() - begin));
- saveAliases();
+ saveDrivers();
+ s_log.info("Application.shutdown->_saveApplicationState: saveDrivers() ELAPSED: " + (System.currentTimeMillis() - begin));
- // Save Application level SQL history.
- saveSQLHistory();
+ saveAliases();
+ s_log.info("Application.shutdown->_saveApplicationState: saveAliases() ELAPSED: " + (System.currentTimeMillis() - begin));
- // Save options selected for Cell Import Export operations
- saveCellImportExportInfo();
+ // Save Application level SQL history.
+ saveSQLHistory();
+ s_log.info("Application.shutdown->_saveApplicationState: saveSQLHistory() ELAPSED: " + (System.currentTimeMillis() - begin));
- // Save options selected for Edit Where Columns
- saveEditWhereColsInfo();
+ // Save options selected for Cell Import Export operations
+ saveCellImportExportInfo();
+ s_log.info("Application.shutdown->_saveApplicationState: saveCellImportExportInfo() ELAPSED: " + (System.currentTimeMillis() - begin));
- // Save options selected for DataType-specific properties
- saveDataTypePreferences();
-
- // Save user specific WIKI configurations
- saveUserSpecificWikiConfigurations();
+ // Save options selected for Edit Where Columns
+ saveEditWhereColsInfo();
+ s_log.info("Application.shutdown->_saveApplicationState: saveEditWhereColsInfo() ELAPSED: " + (System.currentTimeMillis() - begin));
- _prefs.save();
- }
+ // Save options selected for DataType-specific properties
+ saveDataTypePreferences();
+ s_log.info("Application.shutdown->_saveApplicationState: saveDataTypePreferences() ELAPSED: " + (System.currentTimeMillis() - begin));
- /**
+ // Save user specific WIKI configurations
+ saveUserSpecificWikiConfigurations();
+ s_log.info("Application.shutdown->_saveApplicationState: saveUserSpecificWikiConfigurations() ELAPSED: " + (System.currentTimeMillis() - begin));
+
+ _prefs.save();
+ }
+
+ /**
* Builds a Locale from the user's preferred locale preference.
*
* @param prefs
@@ -427,7 +458,7 @@
}
catch (Exception e)
{
- s_log.error("Unexpected exception while attempting to update the launch script: "+e.getMessage(), e);
+ s_log.info("Unexpected exception while attempting to update the launch script: " + e.getMessage());
}
}
Modified: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfoCacheSerializer.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfoCacheSerializer.java 2013-01-08 12:23:22 UTC (rev 6733)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfoCacheSerializer.java 2013-01-11 22:35:59 UTC (rev 6734)
@@ -164,9 +164,9 @@
{
synchronized (SchemaInfoCacheSerializer.class)
{
- if(0 < _storingSessionIDs.size())
+ for(int i=0; 0 < _storingSessionIDs.size() || i >= 30; ++i)
{
- SchemaInfoCacheSerializer.class.wait(30000);
+ SchemaInfoCacheSerializer.class.wait(1000);
}
}
}
Modified: trunk/sql12/doc/src/main/resources/changes.txt
===================================================================
--- trunk/sql12/doc/src/main/resources/changes.txt 2013-01-08 12:23:22 UTC (rev 6733)
+++ trunk/sql12/doc/src/main/resources/changes.txt 2013-01-11 22:35:59 UTC (rev 6734)
@@ -8,6 +8,14 @@
Enhancements:
+Logging of Application shutdown:
+ Sometimes closing SQuirreL can take some time. From looking at the log file
+ one can find out which shutdown actions take long:
+ Choose log level: info
+ Search the log file for: "Application.shutdown"
+ The first Global preferences tab tells where log and log configuration files are.
+
+
Introduced keyboard shortcut Ctrl+Shift+Enter to rerun SQL results.
Thanks to Johnathan James for re-working and drawing attention to the patch hosted at
http://muzso.hu/2011/06/04/patch-for-squirrel-sql-client-v3.2.1-adds-keyboard-shortcut-for-sql-query-rerun-re-execut
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|