-
1. Re: select count(*) on each CMP entity bean creation
seven Nov 18, 2002 8:18 PM (in response to arno.huetter)Probably this is the way the JBOSS CMP engine is detecting PK existence. And yes, I agree, this could be a performance issue with CMP. Did u tested this behaviour with other app servers? Anyway, you can post your comment on the mailing list 'cause you might some interesting answers there. And by the way I don't know how u can prevent it.
-
2. Re: select count(*) on each CMP entity bean creation
jboynes Nov 19, 2002 2:05 AM (in response to arno.huetter)seven is right, it does this check to return a DuplicateKeyException from create(). Assuming you have an index on the PK the performance impact should be small. If you don't have an index on the pk your performance will be really bad anyway (as every load will be a table scan).
There is a patch out there to skip this select which should give a marginal improvement at the cost of less friendly failure modes. The main cost of create though is doing the insert statement.