@SuppressWarnings("unchecked")
@Override
protected DatabaseBackend<K, V, P> getBackendForWriting() throws NoTransactionException, ReadOnlyTransactionException, WrappedIOException
{
Transaction txn = Transaction.getCurrentTransaction();
TransactionCollaborator tc = txn.getCollaborator(this);
if (tc == null)
{
if (txn.isReadOnly())
{
throw new ReadOnlyTransactionException();
}
tc = joinReadWriteTransaction(txn);
}
else
{
if (tc.isReadOnly())
{
throw new ReadOnlyTransactionException();
}
}
return tc.getBackend();
}