@Override public int doGetDurableSubscriberMessageCount(TransactionContext c, ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { if (isPrioritizedMessages) { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatementWithPriority()); } else { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatement()); } s.setString(1, destination.getQualifiedName()); s.setString(2, clientId); s.setString(3, subscriptionName); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }
public int doGetDurableSubscriberMessageCount(TransactionContext c, ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; cleanupExclusiveLock.readLock().lock(); try { if (isPrioritizedMessages) { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatementWithPriority()); } else { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatement()); } s.setString(1, destination.getQualifiedName()); s.setString(2, clientId); s.setString(3, subscriptionName); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { cleanupExclusiveLock.readLock().unlock(); close(rs); close(s); } return result; }
@Override public int doGetDurableSubscriberMessageCount(TransactionContext c, ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { if (isPrioritizedMessages) { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatementWithPriority()); } else { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatement()); } s.setString(1, destination.getQualifiedName()); s.setString(2, clientId); s.setString(3, subscriptionName); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }
@Override public int doGetDurableSubscriberMessageCount(TransactionContext c, ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { if (isPrioritizedMessages) { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatementWithPriority()); } else { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatement()); } s.setString(1, destination.getQualifiedName()); s.setString(2, clientId); s.setString(3, subscriptionName); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }
@Override public int doGetDurableSubscriberMessageCount(TransactionContext c, ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { if (isPrioritizedMessages) { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatementWithPriority()); } else { s = c.getConnection().prepareStatement(this.statements.getDurableSubscriberMessageCountStatement()); } s.setString(1, destination.getQualifiedName()); s.setString(2, clientId); s.setString(3, subscriptionName); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }