return Thread.currentThread().getName();
}
private static String getEntityManagerDetails(EntityManager manager) {
String result = currentThread() + ":"; // show the thread for correlation with other modules
EntityManagerMetadata metadata;
try {
if ((metadata = manager.unwrap(EntityManagerMetadata.class)) != null) {
result += metadata.getPuName() +
((metadata.isTransactionScopedEntityManager()) ? " [XPC]" : " [transactional]"
);
}
} catch (PersistenceException ignoreUnhandled) { // TODO: switch to a different way to lookup EntityManagerMetadata
// so that we don't get this error on TransactionalEntityManager
// (because the EntityManager is the underlying provider that