if (status1 == OperationStatus.SUCCESS && status2 == OperationStatus.SUCCESS) {
SecondaryCursor[] cursors = {cursor1, cursor2}; joinCursor = primaryDb.join(cursors, null);
while (true) { OperationStatus joinStatus = joinCursor.getNext(key, data, LockMode.DEFAULT); if (joinStatus == OperationStatus.SUCCESS) { // Do something with the key and data. } else { break; } } } } finally { if (cursor1 != null) { cursor1.close(); } if (cursor2 != null) { cursor2.close(); } if (joinCursor != null) { joinCursor.close(); } }
|
|