mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
[HHH-4520] (Infinispan second level cache integration can cache stale collection data) testManyUsers now enabled after ISPN-277 was fixed.
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18184 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
6512e3e708
commit
16528acc0b
@ -61,7 +61,7 @@
|
|||||||
*/
|
*/
|
||||||
public class ConcurrentWriteTest extends SingleNodeTestCase {
|
public class ConcurrentWriteTest extends SingleNodeTestCase {
|
||||||
private static final Log log = LogFactory.getLog(ConcurrentWriteTest.class);
|
private static final Log log = LogFactory.getLog(ConcurrentWriteTest.class);
|
||||||
|
private static final boolean trace = log.isTraceEnabled();
|
||||||
/**
|
/**
|
||||||
* when USER_COUNT==1, tests pass, when >4 tests fail
|
* when USER_COUNT==1, tests pass, when >4 tests fail
|
||||||
*/
|
*/
|
||||||
@ -423,15 +423,21 @@ public Void call() throws Exception {
|
|||||||
for (int i = 0; i < ITERATION_COUNT && !TERMINATE_ALL_USERS; i++) {
|
for (int i = 0; i < ITERATION_COUNT && !TERMINATE_ALL_USERS; i++) {
|
||||||
if (contactExists())
|
if (contactExists())
|
||||||
throw new IllegalStateException("contact already exists before add, customerId=" + customerId);
|
throw new IllegalStateException("contact already exists before add, customerId=" + customerId);
|
||||||
|
if (trace) log.trace("Add contact for customer " + customerId);
|
||||||
addContact(customerId);
|
addContact(customerId);
|
||||||
|
if (trace) log.trace("Added contact");
|
||||||
thinkRandomTime();
|
thinkRandomTime();
|
||||||
if (!contactExists())
|
if (!contactExists())
|
||||||
throw new IllegalStateException("contact missing after successful add, customerId=" + customerId);
|
throw new IllegalStateException("contact missing after successful add, customerId=" + customerId);
|
||||||
thinkRandomTime();
|
thinkRandomTime();
|
||||||
|
if (trace) log.trace("Read all customers' first contact");
|
||||||
// read everyone's contacts
|
// read everyone's contacts
|
||||||
readEveryonesFirstContact();
|
readEveryonesFirstContact();
|
||||||
|
if (trace) log.trace("Read completed");
|
||||||
thinkRandomTime();
|
thinkRandomTime();
|
||||||
|
if (trace) log.trace("Remove contact of customer" + customerId);
|
||||||
removeContact(customerId);
|
removeContact(customerId);
|
||||||
|
if (trace) log.trace("Removed contact");
|
||||||
if (contactExists())
|
if (contactExists())
|
||||||
throw new IllegalStateException("contact still exists after successful remove call, customerId=" + customerId);
|
throw new IllegalStateException("contact still exists after successful remove call, customerId=" + customerId);
|
||||||
thinkRandomTime();
|
thinkRandomTime();
|
||||||
|
@ -34,6 +34,9 @@ public SingleNodeTestCase(String string) {
|
|||||||
|
|
||||||
protected TransactionManager getTransactionManager() {
|
protected TransactionManager getTransactionManager() {
|
||||||
try {
|
try {
|
||||||
|
if (getTransactionManagerLookupClass() == null)
|
||||||
|
return null;
|
||||||
|
else
|
||||||
return getTransactionManagerLookupClass().newInstance().getTransactionManager(null);
|
return getTransactionManagerLookupClass().newInstance().getTransactionManager(null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error", e);
|
log.error("Error", e);
|
||||||
@ -81,7 +84,9 @@ public void configure(Configuration cfg) {
|
|||||||
cfg.setProperty(Environment.USE_QUERY_CACHE, String.valueOf(getUseQueryCache()));
|
cfg.setProperty(Environment.USE_QUERY_CACHE, String.valueOf(getUseQueryCache()));
|
||||||
cfg.setProperty(Environment.CACHE_REGION_FACTORY, getCacheRegionFactory().getName());
|
cfg.setProperty(Environment.CACHE_REGION_FACTORY, getCacheRegionFactory().getName());
|
||||||
cfg.setProperty(Environment.CONNECTION_PROVIDER, getConnectionProviderClass().getName());
|
cfg.setProperty(Environment.CONNECTION_PROVIDER, getConnectionProviderClass().getName());
|
||||||
|
if (getTransactionManagerLookupClass() != null) {
|
||||||
cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, getTransactionManagerLookupClass().getName());
|
cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, getTransactionManagerLookupClass().getName());
|
||||||
|
}
|
||||||
cfg.setProperty(Environment.TRANSACTION_STRATEGY, getTransactionFactoryClass().getName());
|
cfg.setProperty(Environment.TRANSACTION_STRATEGY, getTransactionFactoryClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user