[jboss-jira] [JBoss JIRA] Created: (JBCACHE-695) PojoCache transaction rollback has limitation under certain transaction context

Ben Wang (JIRA) jira-events at jboss.com
Fri Jul 14 04:36:11 EDT 2006


PojoCache transaction rollback has limitation under certain transaction context
-------------------------------------------------------------------------------

                 Key: JBCACHE-695
                 URL: http://jira.jboss.com/jira/browse/JBCACHE-695
             Project: JBoss Cache
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: PojoCache
            Reporter: Ben Wang
         Assigned To: Ben Wang
            Priority: Minor
             Fix For: POJOCache


Currently PojoCache supports transaction rollback. For instance,
cache.attach(id, pojo);
is transactional even if there is no user transaction. However, with user transaction,

tx.begin();
cache.attach(id, pojo);
pojo.setAge(20);
tx.rollback();

the replication is rollbacked but the in-memory copy is not, e.g., pojo.getAge() == 20. There is a workaround if you are using transaction by yourself:

// Just make sure this one succeeds first.
tx.begin();
cache.attach(id, pojo);
tx.commit();

// All subsquent field update will be transactional then.
tx.begin();
pojo.setAge(20);
tx.rollback();


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list