firethorn

changeset 4206:55e7f3bc6fc4 2.1.28-tap-issues

Add callback to SQLQuery exception & Some notes
author Stelios <stv@roe.ac.uk>
date Wed Apr 24 14:47:16 2019 +0300 (2019-04-24)
parents edf5bd3168f0
children 27c53ddd01e6
files doc/notes/stv/20190423-Activity-Order-Patterns.txt firethorn-ogsadai/activity/server/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/activity/server/sql/SQLQueryActivity.java
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/notes/stv/20190423-Activity-Order-Patterns.txt	Wed Apr 24 14:47:16 2019 +0300
     1.3 @@ -0,0 +1,103 @@
     1.4 +#
     1.5 +# <meta:header>
     1.6 +#   <meta:licence>
     1.7 +#     Copyright (c) 2018, ROE (http://www.roe.ac.uk/)
     1.8 +#
     1.9 +#     This information is free software: you can redistribute it and/or modify
    1.10 +#     it under the terms of the GNU General Public License as published by
    1.11 +#     the Free Software Foundation, either version 3 of the License, or
    1.12 +#     (at your option) any later version.
    1.13 +#
    1.14 +#     This information is distributed in the hope that it will be useful,
    1.15 +#     but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 +#     GNU General Public License for more details.
    1.18 +#  
    1.19 +#     You should have received a copy of the GNU General Public License
    1.20 +#     along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.21 +#   </meta:licence>
    1.22 +# </meta:header>
    1.23 +#
    1.24 +#
    1.25 +
    1.26 +
    1.27 +Failed Queries
    1.28 +--------------
    1.29 +
    1.30 +1)
    1.31 +
    1.32 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Limits
    1.33 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Delays
    1.34 +PROCESSING: Activity uk.org.ogsadai.SQLQuery
    1.35 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.JdbcInsertData
    1.36 +PROCESSING: Activity uk.org.ogsadai.DeliverToRequestStatus
    1.37 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Context
    1.38 +COMPLETED: Activity uk.ac.roe.wfau.firethorn.Context
    1.39 +
    1.40 +
    1.41 +
    1.42 +2)
    1.43 +
    1.44 +PROCESSING: Activity uk.org.ogsadai.DeliverToRequestStatus
    1.45 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Context
    1.46 +COMPLETED: Activity uk.ac.roe.wfau.firethorn.Context
    1.47 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.JdbcInsertData
    1.48 +PROCESSING: Activity uk.org.ogsadai.SQLQuery
    1.49 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Delays
    1.50 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Limits
    1.51 +
    1.52 +
    1.53 +
    1.54 +3)
    1.55 +
    1.56 +PROCESSING: Activity uk.org.ogsadai.DeliverToRequestStatus
    1.57 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.JdbcInsertData
    1.58 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Context
    1.59 +COMPLETED: Activity uk.ac.roe.wfau.firethorn.Context
    1.60 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Delays
    1.61 +PROCESSING: Activity uk.org.ogsadai.SQLQuery
    1.62 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Limits
    1.63 +
    1.64 +
    1.65 +
    1.66 +
    1.67 +
    1.68 +Graceful Failed Queries
    1.69 +-----------------------
    1.70 +
    1.71 +1)
    1.72 +
    1.73 +PROCESSING: Activity uk.org.ogsadai.DeliverToRequestStatus
    1.74 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Limits
    1.75 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Context
    1.76 +PROCESSING: Activity uk.org.ogsadai.SQLQuery
    1.77 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Delays
    1.78 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.JdbcInsertData
    1.79 +COMPLETED: Activity uk.ac.roe.wfau.firethorn.Context
    1.80 +
    1.81 +
    1.82 +
    1.83 +2)
    1.84 +
    1.85 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Limits
    1.86 +PROCESSING: Activity uk.org.ogsadai.SQLQuery
    1.87 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Delays
    1.88 +PROCESSING: Activity uk.org.ogsadai.DeliverToRequestStatus
    1.89 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.JdbcInsertData
    1.90 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Context
    1.91 +COMPLETED: Activity uk.ac.roe.wfau.firethorn.Context
    1.92 +
    1.93 +
    1.94 +
    1.95 +
    1.96 +3)
    1.97 +
    1.98 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.JdbcInsertData
    1.99 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Delays 
   1.100 +PROCESSING: Activity uk.org.ogsadai.SQLQuery
   1.101 +PROCESSING: Activity uk.org.ogsadai.DeliverToRequestStatus
   1.102 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Context
   1.103 +PROCESSING: Activity uk.ac.roe.wfau.firethorn.Limits
   1.104 +COMPLETED: Activity uk.ac.roe.wfau.firethorn.Context
   1.105 +
   1.106 +
     2.1 --- a/firethorn-ogsadai/activity/server/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/activity/server/sql/SQLQueryActivity.java	Sun Apr 21 15:45:44 2019 +0300
     2.2 +++ b/firethorn-ogsadai/activity/server/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/activity/server/sql/SQLQueryActivity.java	Wed Apr 24 14:47:16 2019 +0300
     2.3 @@ -320,8 +320,9 @@
     2.4  
     2.5          catch (SQLException e)
     2.6              {
     2.7 -            logger.debug("Caught a SQLException, wrapping it in an ActivitySQLUserException");
     2.8 -            throw new ActivitySQLUserException(e);
     2.9 +	    logger.debug("Caught a SQLException, sending a callback");
    2.10 +	    callback.failed();
    2.11 +	    throw new ActivitySQLUserException(e);
    2.12              }
    2.13          catch (PipeIOException e)
    2.14              {
    2.15 @@ -414,7 +415,21 @@
    2.16          @Override
    2.17          public ResultSet call() throws Exception
    2.18          {
    2.19 -            mContext.monkey().sqlException(this, "Eoph9xie");
    2.20 +            if (mContext.monkey().test(this, "Eoph9xie"))
    2.21 +	    {
    2.22 +                try {
    2.23 +                    Thread.sleep(100);
    2.24 +                }
    2.25 +                catch (InterruptedException ouch)
    2.26 +                {
    2.27 +                    logger.debug("Sleep interrupted");
    2.28 +                }
    2.29 +                
    2.30 +                 throw new SQLException(
    2.31 +                     "Delayed SQLException"
    2.32 +                 );
    2.33 +            }
    2.34 +
    2.35              final ResultSet results = super.call();
    2.36              mContext.monkey().sqlException(this, "oz4Kie0M");
    2.37              return results;