tr = new TransactionRepository(pm, new IdManager("TRANSACTION_ID", 10, pm));
tr = new TransactionRepository(pm, idm);
   public void testRecoverableQueueCrash() throws Throwable   {      PagingFilteredQueue queue = new PagingFilteredQueue("queue1", 1, ms, pm, true, true, new QueuedExecutor(), null, 100, 20, 10);      Message[] msgs = new Message[200];            MessageReference[] refs = new MessageReference[200];             //Send 150 np mesages      for (int i = 0; i < 150; i++)      {         msgs[i] = CoreMessageFactory.createCoreMessage(i, false, null);                  refs[i] = ms.reference(msgs[i]);                         queue.handle(null, refs[i], null);                   refs[i].releaseMemoryReference();      }            //Send 50 p messages      for (int i = 150; i < 200; i++)      {         msgs[i] = CoreMessageFactory.createCoreMessage(i, true, null);                  refs[i] = ms.reference(msgs[i]);                         queue.handle(null, refs[i], null);                   refs[i].releaseMemoryReference();      }      List refIds = getReferenceIdsOrderedByPageOrd(queue.getChannelID());      assertEquals(100, refIds.size());                                                      assertEquals(100, queue.memoryRefCount());            assertEquals(0, queue.downCacheCount());            assertTrue(queue.isPaging());                  assertEquals(0, queue.memoryDeliveryCount());            //Stop and restart the persistence manager      //All the paged refs will survive             pm.stop();      tr.stop();      ms.stop();            pm =         new JDBCPersistenceManager(sc.getDataSource(), sc.getTransactionManager(), null,                                    true, true, true, 100);            pm.start();            tr = new TransactionRepository(pm, new IdManager("TRANSACTION_ID", 10, pm));      tr.start();            ms = new SimpleMessageStore();      ms.start();            queue = null;            PagingFilteredQueue queue2 = new PagingFilteredQueue("queue1", 1, ms, pm, true, true, new QueuedExecutor(), null, 100, 20, 10);      queue2.deactivate();      queue2.load();            refIds = getReferenceIdsOrderedByPageOrd(queue2.getChannelID());      assertEquals(50, refIds.size());            assertEquals(100, queue2.memoryRefCount());      assertEquals(0, queue2.downCacheCount());      assertFalse(queue2.isPaging());                  assertEquals(0, queue2.memoryDeliveryCount());                         this.consume(queue2, 100, refs, 100);            refIds = getReferenceIdsOrderedByPageOrd(queue2.getChannelID());      assertEquals(0, refIds.size());                                                      assertEquals(0, queue2.memoryRefCount());            assertEquals(0, queue2.downCacheCount());            assertFalse(queue2.isPaging());                  assertEquals(0, queue2.memoryDeliveryCount());            assertEquals(0, queue2.messageCount());            assertEquals(0, LockMap.instance.getSize());   }