A call without any transaction on a business method which does not require a transaction cannot use the EntityManager after making a query. The Query object is wrapped by JtaQuery which closes the EntityManager after any call to the object. The following is an example that does not work when called outside of any transaction, where em is the injected EntityManager:
public City getCity(String cityName)
The first call to getResultList() is OK, but the second call fails because it already closed the EntityManager. The following stack trace excerpt shows the stack in OpenEJB during the second call to getResultList():
Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManager.