Hey guys, I just noticed that a part of code I worked on saves the same entity twice. I tried several tricks, like flush() and Transaction REQUIRES_NEW but nothing does it. But I can see while debugging that after calling persist(entity), I get an ID (IDENTITY) for that entity... but just a bit later in the code if I look at the variables I'll see the same entity with a different ID and two itenties with those IDs in the Table.
This is using Java EE 6 with Glassfish 3.0.1