try {
EntityTransaction txn = emExec.getTransaction();
txn.begin();
try {
for (MetadataEntityKey metadataKey : batch) {
MetadataEntity metadata = findMetadata(emExec, metadataKey);
// check for transaction - I hope write skew check is done here
if (metadata.getExpiration() > currentTime) {
continue;
}
final Object key;
try {
key = marshaller.objectFromByteBuffer(metadata.getKeyBytes());
} catch (Exception e) {
throw new JpaStoreException("Cannot unmarshall key", e);
}
Object entity = null;
try {