Have you turned on DEBUG for the org.jboss.ejb.plugins.cmp category in the log4j.xml configuration file?
When you do you will see the SQL executed for the findAll command. What is the this SQL?
Also, have you upgraded to 3.0.1 final release?
2002-08-08 23:41:54,274 INFO [STDOUT] PartInventorySessionBean.ejbCreate()
2002-08-08 23:41:54,574 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindAllQuery.enterprise/PartInventoryEntity.findAll] Executing SQL: SELECT Id FROM PartInventory
2002-08-08 23:41:54,704 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.enterprise/PartInventoryEntity] Executing SQL: SELECT Id,PartName, Description, Type, Account, OnHand, Price FROM PartInventory WHERE (Id=?) OR (Id=?) OR (Id=?)
2002-08-08 23:41:54,774 INFO [STDOUT] TTTT:ejb/enterprise/PartInventoryEntity:[.3.]
Why does it ask repeatly for Id=? or Id=? or Id=?
The jaws.xml looks fine.
What is wrong?
That is the load query. The finder is correct in executing this:
SQL: SELECT Id FROM PartInventory
JBossCMP does not use the jaws.xml file; it uses the jbosscmp-jdbc.xml file. I suggest you read the quick start guide available on our download page at source forge.
I found what is wrong with it. It is in the code. It actually skip every other record.
Regarding multiple of OR in WHERE clause, the CMP first select id (primary key) and then select again for each id. So, the number of OR depends on the number of records. Why the implementation does not use select * from table instead of query the table twice?
It can. You just don't have it configured that way. For a lot of applications selection all the column from all the rows will cause the application to run out of memory. The configuration of optimized loading is covered in chaper 6 of the JBossCMP documentation.
Could you tell me where to download the upgraded 3.0.1 final release version ?