[#5016] Add DBMS_AQ.dequeueIterable() to create an Oracle AQ Iterable

This commit is contained in:
lukaseder 2016-01-30 18:48:57 +01:00
parent 12b2826585
commit 4952bc1cf8

View File

@ -137,6 +137,26 @@ public class OracleAQExamples extends Utils {
});
}
@Test
public void testAQIterable() throws Exception {
dsl.transaction(c -> {
// Enqueue all authors
authors.stream().forEach(a -> {
DBMS_AQ.enqueue(dsl.configuration(), NEW_AUTHOR_AQ, a);
});
// Dequeue them again
int i = 0;
for (AuthorTRecord author : DBMS_AQ.dequeueIterable(dsl.configuration(), NEW_AUTHOR_AQ)) {
assertEquals(authors.get(i++), author);
if (i == authors.size())
break;
}
});
}
@Test
public void testAQWait() throws Exception {
dsl.transaction(c -> {