increased RequestProcessor throughput, could not notice any side effects
authorchrislovsund@netbeans.org
Fri, 17 May 2013 15:27:48 +0200
changeset 40322fdc507e8c3
parent 402 cb020c7e10a6
child 404 365292a542a4
increased RequestProcessor throughput, could not notice any side effects
EADS-3700 - Not able to execute more than one thing at the time
PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlExecuteAction.java
PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlFileExecutor.java
     1.1 --- a/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlExecuteAction.java	Fri May 17 15:22:34 2013 +0200
     1.2 +++ b/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlExecuteAction.java	Fri May 17 15:27:48 2013 +0200
     1.3 @@ -90,7 +90,7 @@
     1.4  
     1.5      private static final Logger LOG = Logger.getLogger(PlsqlExecuteAction.class.getName());
     1.6      private static final String ICON_PATH = "org/netbeans/modules/plsql/execution/execute.png";
     1.7 -    private static final RequestProcessor RP = new RequestProcessor(PlsqlExecuteAction.class);
     1.8 +    private static final RequestProcessor RP = new RequestProcessor(PlsqlExecuteAction.class.getName(), 4);
     1.9      private static final PlsqlFileValidatorService validator = Lookup.getDefault().lookup(PlsqlFileValidatorService.class);
    1.10      private static final String DATABASE_CONNECTION_KEY = "databaseConnection";
    1.11      private static final String TEST_BLOCK_NAME_PREFIX = "TestBlock:";
     2.1 --- a/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlFileExecutor.java	Fri May 17 15:22:34 2013 +0200
     2.2 +++ b/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlFileExecutor.java	Fri May 17 15:27:48 2013 +0200
     2.3 @@ -103,11 +103,9 @@
     2.4  
     2.5  public class PlsqlFileExecutor {
     2.6  
     2.7 +    private static final RequestProcessor RP = new RequestProcessor("SQLExecution", 4, true);
     2.8      private static final PlsqlFileValidatorService validator = Lookup.getDefault().lookup(PlsqlFileValidatorService.class);
     2.9      private boolean cancel = false;
    2.10 -    private final RequestProcessor rp = new RequestProcessor("SQLExecution", 1, true);
    2.11 -    // execution results. Not synchronized since accessed only from rp of throughput 1.
    2.12 -    private SQLExecutionResults executionResults;
    2.13      private final DatabaseConnection connection;
    2.14      private Connection debugConnection;
    2.15      private DatabaseContentManager cache;
    2.16 @@ -166,7 +164,7 @@
    2.17          String formattedQuery = formatQuery(query, con);
    2.18          DataObject obj = FileExecutionUtil.getDataObject(doc);
    2.19          SQLExecutor executor = new SQLExecutor(obj, con, formattedQuery, label);
    2.20 -        RequestProcessor.Task task = rp.create(executor);
    2.21 +        RequestProcessor.Task task = RP.create(executor);
    2.22          executor.setTask(task);
    2.23          task.run();
    2.24          return false;
    2.25 @@ -1294,10 +1292,6 @@
    2.26          return newString.toString();
    2.27      }
    2.28  
    2.29 -    private void setExecutionResults(SQLExecutionResults executionResults) {
    2.30 -        this.executionResults = executionResults;
    2.31 -    }
    2.32 -
    2.33      private void setResultsToEditors(final SQLExecutionResults results, final DataObject obj, final String label) {
    2.34          if (results != null) {
    2.35              final List<Component> components = new ArrayList<Component>();
    2.36 @@ -1475,8 +1469,6 @@
    2.37                  return;
    2.38              }
    2.39  
    2.40 -            setExecutionResults(executionResults);
    2.41 -
    2.42              if (executionResults.size() <= 0) {
    2.43                  // no results, but successfull
    2.44                  return;