ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
MarshalledValueOutputStream os = new MarshalledValueOutputStream(baos);
cache.getMarshaller().objectToObjectStream(DefaultStateTransferManager.STREAMING_DELIMITER_NODE, os);
os.close();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
MarshalledValueInputStream is = new MarshalledValueInputStream(bais);
loader.storeEntireState(is);
is.close();
Object txnKey = new Object();
loader.prepare(txnKey, mods, false);
loader.commit(txnKey);
try
{
loader.commit(txnKey);
fail();
}
catch (IllegalArgumentException expected)
{
}
try
{
loader.rollback(txnKey);
fail();
}
catch (IllegalArgumentException expected)
{
}
/* Commit and rollback after rollback. */
bais = new ByteArrayInputStream(baos.toByteArray());
is = new MarshalledValueInputStream(bais);
loader.storeEntireState(is);
is.close();
txnKey = new Object();
loader.prepare(txnKey, mods, false);