EntityManager throws TransactionRequiredException on merge() in JBoss JSF bean
问题 I've set up a JSF application on JBoss 5.0.1GA to present a list of Users in a table and allow deleting of individual users via a button next to each user. When deleteUser is called, the call is passed to a UserDAOBean which gets an EntityManager injected from JBoss. I'm using the code public void delete(E entity) { em.remove(em.merge(entity)); } to delete the user (code was c&p from a JPA tutorial). Just calling em.remove(entity) has no effect and still causes the same exception. When this