I am trying to delete entity but I get this exception:
java.lang.IllegalArgumentException: Removing a detached instance
I understand that my problem is that I am using two different EntityManger instances. I looked out for a solution but all the solutions that I found was something like this:
entityManger.remove(entityManger.merge(entity));
There is another way to solve this issue instead of using merge and remove function?