I have a session bean with 2 methods:
findActiveOrders: calls a EJB-QL select method and return a Collection of static data.
updateOrderField(pk, field, value): calls the proper set method on the Entity Bean using reflection.
The problem is that every time I call updateOrderField. The Orders Entity Beans executes the following select on the database.
13:13:40,394 DEBUG [Orders] Executing SQL: SELECT ORDERID, [...all fields...] FROM ORDERS WHERE (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?) OR (ORDERID=?)
The bigger the Collection returned by findActiveOrders the bigger the list ORed ORDERIDs in the select. ( for a collection of about 1000, there is about 250 ORed ORERIDs)
Is there a local Entity Bean cache for the SessionBean? I am only updating one Entity Bean why does JBoss re-select multiple rows?
Can I turn this off because it really slows down the processing of updates.