Bugs item #541571, was opened at 2002-04-09 16:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=541571&group_id=22866
Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Lipp (mlipp) Assigned to: Nobody/Anonymous (nobody) Summary: INSERTING AN ALREADY EXISTING BEAN Initial Comment: Please do not close immediately. Yes, I have read bug 504481. Discussion of bug 504481 was spoiled by the reporter's initial modification of the database outside of JBoss. But as has been mentioned, the bug occurs also if things are done properly. Here is what we do: (1) Create an EntityBean and perform some methods on it. (2) Remove the EntityBean (ejbRemove) (3) Create a new EntityBean, reusing the primary key. --> Error: INSERTING AN ALREADY EXISTING BEAN. All this is done with commit option 'A'. There is nothing wrong about that. This is just a performance optimization (and we need this optimization!) that avoids reloading the EJB's data from the data base if the EJB is still cached. The EJB is removed from the database (we have verified that). So why might JBoss assume that we are trying to insert an existing bean? Simply because it indexes its cache by primary keys, and obviously the primary key is not removed from the cache index after the ejbRemove. Now, of course, you can work around this by choosing commit option 'C' and thus force the removal of the EJB's primary key from the cache index (it is removed because of the forced passivation). But this can really only be a workaround, as it results (in our case) in lots of database reload-traffic that slows down our application (which is mostly read-only, has a large pool etc. etc.) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=541571&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development