as the exception says you problems is:
"detached entity passed to persist:"
try to attach your entity first by calling "merge" method of your "EntityManager"
if problem is not solved send the entity definitions and the lines that you are using to persist the entity.