Thanks everyone for the comments. To answer the questions:
1) My theory why the problem does not appear with user transactions is that my code in that case is a bit convoluted with several components involved. I guess that optimization simply fails because of that and the update is executed. In the other case with the container-managed transaction, the merge and remove are immediately next to each other.
2) If I remove the deletion, then the update is executed just fine.
3) Flushing after the update solves the problem.
Many thanks,
Ulrich
[Message sent by forum member 'ulim' (ulim)]
http://forums.java.net/jive/thread.jspa?messageID=257231