try {
session = em.unwrap(Session.class);
} catch (Throwable th) {
logger.error("Failed to unwrap Hibernate Session from JPA "
+ "EntityManager: " + th.getMessage(), th);
throw new JizzBlobException("Failed to unwrap Hibernate Session "
+ "from JPA EntityManager: " + th.getMessage(), th);
}
try {
session.doWork(new org.hibernate.jdbc.Work() {
@Override
public void execute(Connection connection) throws SQLException {
try {
work.execute(connection);
} catch (Throwable th) {
logger.error(
"Error executing JDBC work package: "
+ th.getMessage(), th);
throw th;
}
}
});
} catch (Throwable th) {
logger.error(
"Error executing JDBC work package: " + th.getMessage(), th);
throw new JizzBlobException("Error executing JDBC work package: "
+ th.getMessage(), th);
}
}