I encountered the following problem using either JBOSS 2.4.4 or 2.4.6:
calling a session-bean method (tx required), which first deletes an cmp-entity-bean and afterwards tries to insert an entity-bean with the same primary-key fails with "INSERTING AN ALREADY EXISTING BEAN". However if I change the commit-option for that bean to C everything works fine. Btw. the primary-key is a simple String.
Later on I changed my testcase:
In the first method call to the session bean I delete the entity-bean. Database profiling shows me the delete-statement and a look in the DB ensures that the corresponding row is deleted.
Then in the second call (new Tx) I check for existence of the entity bean (home.findByPrimaryKey(key)) and the finder returns the entity bean, although it doesn't exist in the DB.
Any ideas?? I don't like switching to commit-option C!
If I remember correctly (I have not use JAWS in a long time) this is caused by a custom primary key class with a bad hashcode or equals method.