Thank you for the suggestion. I want to clarify my understanding of your solution and see if there is any better way to do this. I will present 3 options and hopefully you can help me to figure out which of these is the best way to do things with DevForce.
OPTION 1: This is the most basic way we can query for new orders:
(1) I run a query that returns 30 orders meeting a certain criteria
(2) 10 new orders are added to the system over the next 10 minutes
(3) I run the same query again, and this time i should get 40 orders. If I use DevForce, I will have to use a DataSourceOnly or DataSourceThenCache QueryStrategy because I need to check the database to get the new orders. This strategy will send all 40 orders back over the network, clogging network resources.
OPTION 2: Your solution is to follow these steps:
(1) I run a query that returns 30 orders meeting a certain criteria
(2) I store the date that the query was last run as our (LastRunDate)
(3) 10 new orders are added to the system over the next 10 minutes.
(4) I run a query to get all orders which match my criteria that were added since our (LastRunDate).
(5) I merge these new orders with my old orders, thus minimizing network traffic.
OPTION 3: Is options 2 a more optimized solution than the following?
(1) I run a query that returns 30 orders meeting a certain criteria
(3) 10 new orders are added to the system over the next 10 minutes.
(4) I run a query to get all orders which match my criteria and I add a "NOT" clause which excludes order which match the primary keys of the orders already in the list.
(5) I merge these new orders with my old orders, thus minimizing network traffic.
I am wondering what the most optimized way to do this would be. I suppose that since our primary key is automatically indexed, the best processing speed (on the server side) would be to eliminate certain records based on their primary key. This however poses the problem that we are adding a good amount of additional outgoing network traffic to send the list of primary keys to the server. A big concern with our application is speed, so I would like to know which way would be more likely to minimize the overall query time for new orders.
I appreciate your help with this issue.