]
RH Bugzilla Integration updated ISPN-586:
-----------------------------------------
Bugzilla References:
ManagedConnectionPool doesn't work in a transactional context
-------------------------------------------------------------
Key: ISPN-586
URL:
https://issues.jboss.org/browse/ISPN-586
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores, Transactions
Affects Versions: 4.1.0.CR2
Reporter: Manik Surtani
Assignee: Mircea Markus
Labels: cachestore, jdbc, transactions
Fix For: 4.1.0.CR3
From the reporter:
"Anyways, what seems to be the real problem is that all the things that need to be
persisted are saved in memory and then when the transaction is completing (either in
prepare or commit phase) the loader attempts to get a connection from the datasource.
Apparently this is illegal and throws an exception which is what causes the
HeuristicMixedException further up the chain.
This only fails when using a ManagedConnectionFactory. If I swap out a
PooledConnectionFactory it works fine. I presume the managed version fails because it
returns the same connection that is part of the active transaction for that thread and you
can't perform new operations on that connection once the transaction is already in
prepare or commit. This feels like a bit of a design flaw to me... I didn't see an
obvious fix."
This possibly has to do with the AbstractCacheStore doing the following in prepare():
"
public void prepare(List<? extends Modification> mods, GlobalTransaction tx,
boolean isOnePhase) throws CacheLoaderException {
if (isOnePhase) {
applyModifications(mods);
} else {
transactions.put(tx, mods);
}
}
"
and later during commit actually writing the changes to the store. This generic,
"abstract" behaviour is intended for non-transactional data stores (such as a
filesystem). Behaviour should be different when it comes to transactional data stores.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: