entityManager.getTransaction().begin();
// inserts a book
Book book = new Book();
book.setId(ID);
book.setName(ENTITY_NAME);
entityManager.persist(book);
// verifies if the transaction is marked as ACTIVE
assertTrue(entityManager.getTransaction().isActive(),
"The transaction is active, but the container returned false when the method isActive was called.");
// verify if the rollbackonly is not set.
assertFalse(entityManager.getTransaction().getRollbackOnly(),