3 Replies Latest reply on Feb 19, 2010 7:46 PM by saltnlight5

    proper examples cleanup?

    saltnlight5

      Hi,

       

      In few of the jms examples I saw, they have this cleanup code in a finally block:

       

               if (initialContext != null)
               {
                  initialContext.close();
               }
               if (connection != null)
               {
                  connection.close();
               }

       

       

       

      You probably should add another try/catch block to "initialContext.close();" because if it were to throw exception, you jms connection.close() will not be called.

       

      -Z