* and only the writeCursor parameter is honored. This is the only
* meaningful cursor attribute for CDB, and here we count on
* writeCursor flag being set correctly by the caller.
*/
List cursors;
CursorConfig cdbConfig;
if (writeCursor) {
if (cdbCursors.readCursors.size() > 0) {
/*
* Although CDB allows opening a write cursor when a read
* cursor is open, a self-deadlock will occur if a write is
* attempted for a record that is read-locked; we should
* avoid self-deadlocks at all costs
*/
throw new IllegalStateException
("Cannot open CDB write cursor when read cursor " +
"is open");
}
cursors = cdbCursors.writeCursors;
cdbConfig = new CursorConfig();
DbCompat.setWriteCursor(cdbConfig, true);
} else {
cursors = cdbCursors.readCursors;
cdbConfig = null;
}