firethorn

changeset 4237:4de654d0e06a 2.1.31-stv-cleanup

Cleanup method change
author Stelios <stv@roe.ac.uk>
date Thu May 30 19:57:08 2019 +0300 (2019-05-30)
parents 1c77fe343c5f
children 919418055ef1 218b84e965f4
files firethorn-ogsadai/activity/server/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/activity/server/sql/SQLQueryActivity.java
line diff
     1.1 --- a/firethorn-ogsadai/activity/server/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/activity/server/sql/SQLQueryActivity.java	Thu May 30 19:51:09 2019 +0300
     1.2 +++ b/firethorn-ogsadai/activity/server/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/activity/server/sql/SQLQueryActivity.java	Thu May 30 19:57:08 2019 +0300
     1.3 @@ -478,21 +478,45 @@
     1.4      protected void cleanUp() throws Exception
     1.5      {
     1.6          super.cleanUp();
     1.7 -        
     1.8 -        logger.debug("Shutting down ExecutorService");
     1.9 -        mExecutorService.shutdown();
    1.10 -        
    1.11 +
    1.12 +        logger.debug("cleanUp()");
    1.13 +        if (mExecutorService != null)
    1.14 +        {
    1.15 +            try {
    1.16 +                logger.debug("Shutting down ExecutorService");
    1.17 +                mContext.monkey().sqlException(this, "caiR6thi");
    1.18 +                mExecutorService.shutdown();
    1.19 +            }
    1.20 +            catch (final Exception ouch)
    1.21 +            {
    1.22 +                logger.debug("Shutting down ExecutorService threw an Exception [" + ouch.getMessage() + "]");
    1.23 +            }
    1.24 +        }
    1.25          if (mStatement != null)
    1.26          {
    1.27 -            logger.debug("Closing Statement");
    1.28 -            mContext.monkey().sqlException(this, "baivahP0");
    1.29 -            mStatement.close();
    1.30 +            try {
    1.31 +                logger.debug("Closing Statement");
    1.32 +                mContext.monkey().sqlException(this, "baivahP0");
    1.33 +                mStatement.close();
    1.34 +            }
    1.35 +            catch (final Exception ouch)
    1.36 +            {
    1.37 +                logger.debug("Closing Statement threw an Exception [" + ouch.getMessage() + "]");
    1.38 +            }
    1.39          }
    1.40  
    1.41 -        if (mResource != null)
    1.42 +        if (mConnection != null)
    1.43          {
    1.44 -            logger.debug("Releasing Connection");
    1.45 -            mConnectionProvider.releaseConnection(mConnection);
    1.46 +            try {
    1.47 +                logger.debug("Releasing Connection");
    1.48 +                mContext.monkey().sqlException(this, "echo4ieW");
    1.49 +                mConnectionProvider.releaseConnection(mConnection);
    1.50 +            }
    1.51 +            catch (final Exception ouch)
    1.52 +            {
    1.53 +                logger.debug("Releasing Connection threw an Exception [" + ouch.getMessage() + "]");
    1.54 +            }
    1.55          }
    1.56      }
    1.57 +
    1.58  }