When getting a connection from a XA datasource retrieved via a JNDI lookup within an ejb, exceptions like in
occure. The solution is to
not close the connection (i. e. in a finally block) after finishing the operations. In my opinion, in a managed environment like in an
appsever where connection pooling is used, the close-operation should do nothing and it should definitly not cause an exception.