Your query should fail in the 2nd call because there will be 2 rows with somedata of "xxx". You do not remove created entity in the @After method, but you marked the id field with @GeneratedValue, so the 2nd add will create one more entity and the query will return both of them because both of them have "xxx" in the somedata column.
-marina
[Message sent by forum member 'mvatkina']
http://forums.java.net/jive/thread.jspa?messageID=393397