throw new JBossJMSException("Failed to load durable subscriptions for topic", e);
throw new MessagingJMSException("Failed to load durable subscriptions for topic", e);
   protected List loadDurableSubscriptionsForTopic(String topicName,                                                                                                 MessageStore ms,                                                  PersistenceManager pm) throws JMSException   {            try      {                  List result = new ArrayList();                  try         {            Connection conn = null;            PreparedStatement ps  = null;            ResultSet rs = null;            TransactionWrapper wrap = new TransactionWrapper();            int rowCount = -1;                        try            {               conn = ds.getConnection();                     ps = conn.prepareStatement(selectSubscriptionsForTopic);                              ps.setString(1, topicName);                              rs = ps.executeQuery();                              rowCount = 0;                              while (rs.next())               {                  rowCount ++;                  long id = rs.getLong(1);                  String clientId = rs.getString(2);                  String subName = rs.getString(3);                  String selector = rs.getString(4);                  boolean noLocal = rs.getString(5).equals("Y");                                                      CoreDurableSubscription sub = getDurableSubscription(clientId, subName);                                    if (sub == null)                  {                     sub = createDurableSubscriptionInternal(id, topicName,                                                            clientId,                                                            subName,                                                            selector,                                                            noLocal,                                                            ms, pm);                     result.add(sub);                  }                                 }            }            catch (SQLException e)            {               wrap.exceptionOccurred();               throw e;            }            finally            {               if (log.isTraceEnabled())               {                  String s = JDBCUtil.statementToString(selectSubscriptionsForTopic, topicName);                  log.trace(s + " returned " + rowCount + " rows");               }                           if (rs != null)               {                  rs.close();               }               if (ps != null)               {                  ps.close();               }               if (conn != null)               {                  conn.close();               }               wrap.end();            }         }         catch (Exception e)         {            final String msg = "Failed to get durable subscription";            log.error(msg, e);            JMSException e2 = new JMSException(msg);            e2.setLinkedException(e);            throw e2;         }                          return result;      }      catch (Exception e)      {         throw new JBossJMSException("Failed to load durable subscriptions for topic", e);              }   }