Details
-
Bug
-
Resolution: Won't Do
-
Major
-
5.1.0.CR1
-
None
Description
putForExternalRead(PFER) suspends the transaction before invoking the underlaying put, which throws a ISException as the call is not performed in a transactional context.
Here is the unit test:
/** * @author Mircea Markus <mircea.markus@jboss.com> (C) 2011 Red Hat Inc. * @since 5.1 */ @Test (groups = "functional", testName = "tx.NoAutoCommitAndPferTest") public class NoAutoCommitAndPferTest extends SingleCacheManagerTest { @Override protected EmbeddedCacheManager createCacheManager() throws Exception { Configuration dsc = getDefaultStandaloneConfig(true); dsc.fluent().transaction().autoCommit(false); return new DefaultCacheManager(dsc); } public void testPferNoAutoCommitExplicitTransaction() throws Exception { tm().begin(); cache.putForExternalRead("k","v"); tm().commit(); assert cache.get("k").equals("v"); //here is the failure! } public void testPferNoAutoCommit() throws Exception { cache.putForExternalRead("k","v"); assert cache.get("k").equals("v"); //here is the failure! } }