In second case we learnt that we couldn't do any more operations on the em as the transaction is closed, is this the expected behavior?
If yes can anyone please suggest a different way to handle these scenarios ?
posted 4 years ago
It's not whether the session is closed or opened, It's JPAs way to handle duplicates.
This exception is thrown when you try to persist a duplicate entity.