/** * Return the next Id. * <p> * If a Transaction has been passed in use the Connection from it. * </p> */ public Object nextId(Transaction t) { synchronized (monitor) { if (idList.isEmpty()) { loadMoreIds(batchSize, t); } Long nextId = idList.remove(0); if (batchSize > 1) { if (idList.size() <= batchSize / 2) { loadBatchInBackground(); } } return nextId; } }
/** * Return the next Id. * <p> * If a Transaction has been passed in use the Connection from it. * </p> */ public Object nextId(Transaction t) { synchronized (monitor) { if (idList.size() == 0){ loadMoreIds(batchSize, t); } Integer nextId = idList.remove(0); if (batchSize > 1) { if (idList.size() <= batchSize/2){ loadBatchInBackground(); } } return nextId; } }
/** * Return the next Id. * <p> * If a Transaction has been passed in use the Connection from it. * </p> */ public Object nextId(Transaction t) { synchronized (monitor) { if (idList.size() == 0) { loadMoreIds(batchSize, t); } Integer nextId = idList.remove(0); if (batchSize > 1) { if (idList.size() <= batchSize / 2) { loadBatchInBackground(); } } return nextId; } }