In ReplicationInterceptor.invoke() the Transaction Manager = com.ibm.ws.Transaction.JTA.TranManagerSet@17adf499 and Transaction = com.ibm.ws.Transaction.JTA.TransactionImpl@18e834bf#tid=2
In TreeCache.getLocalTransaction() the Transaction Manager = com.ibm.ws.Transaction.JTA.TranManagerSet@17adf499 and Transaction = null
I am unable to understand why am I getting null transaction in TreeCache.getLocalTransaction().
I just checked the hibernate 3 source. Transaction is suspended before invoking certain methods of jboss treecache. Thats why cache replication is taking prior to transaction commit.
I might be missing something but isn't that the behavior that's desired if your cache is REPL_SYNC. This means that a commit should only be performed after all nodes confirm that they have the same data. If you want different behavior try setting your cache to REPL_ASYNC
Here are few lines from the treecache tutorial(http://docs.jboss.org/jbcache/current/TreeCache/html/) -
When a change is made to the TreeCache, and that change is done in the context of a transaction, then we wait with replication until the TX commits successfully. All modifications are kept in a list associated with the transaction for the caller. When the TX commits, we replicate the changes. Otherwise, (on a rollback) we simply undo the changes and release the locks, resulting in no replication traffic. For example, if a caller makes 100 modifications and then rolls back the TX, we will not replicate anything, resulting in no network traffic
It says that replication doesnt takes place after every change, rather the changes are replicated all together on transaction commit. I just want to ensure this statement still stands.