continue;
}
EntityTransaction txn = em.getTransaction();
Object tempEntity = null;
InternalMetadata tempMetadata = null;
boolean loaded = false;
txn.begin();
try {
do {
try {
tempEntity = fetchValue ? em.find(configuration.entityClass(), key) : null;
tempMetadata = fetchMetadata ? getMetadata(em, key) : null;
} finally {
try {
txn.commit();
loaded = true;
} catch (Exception e) {
log.trace("Failed to load once", e);
}
}
} while (!loaded);
} finally {
if (txn != null && txn.isActive())
txn.rollback();
}
final Object entity = tempEntity;
final InternalMetadata metadata = tempMetadata;
if (trace) log.trace("Processing " + key + " -> " + entity + "(" + metadata + ")");
if (metadata != null && metadata.isExpired(timeService.wallClockTime())) continue;
eacs.submit(new Callable<Void>() {
@Override
public Void call() throws Exception {
try {
final MarshalledEntry marshalledEntry = marshallerEntryFactory.newMarshalledEntry(key, entity, metadata);