cursor = getDeliveryDb().openCursor(null, null);
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
keyBinding.objectToEntry(new QueueEntryKey(queue.getId(),0l), key);
if(cursor.getSearchKeyRange(key,value,LockMode.DEFAULT) == OperationStatus.SUCCESS)
{
QueueEntryKey entry = keyBinding.entryToObject(key);
if(entry.getQueueId().equals(queue.getId()))