יום רביעי, 6 ביולי 2011

Cursor Modes for ExecuteQuery

Ignorance is bliss.A lot has been written about the cursor modes when using ExecuteQuery method. As a general rule by birth we are told, when using the ExecuteQuery method in scripting, the recommended cursor mode is ForwardOnly if there is no need to step backward through the result set.

But ForwardOnly cursor mode should not be used in a user interface context, for example, when the business component being queried is displayed within an applet of the current view.


I was victim of this ignorance. We had a requirement of querying on the EBC based on the query spec we get from other applet in the view. I have added ForwardOnly mode in the executequery method and to my horror query results were always returning only one record in the applet. Turning on the ForwardBackword cursor mode in the ExecuteQuery method fixed this isssue. The issue was When accessing database records with a cursor mode of ForwardOnly, only one record at a time is retrieved and kept within the Siebel Object Manager memory as a result only one record was being displayed as query result. When using ForwardBackward cursor mode, all of the qualifying records were retrieved.

Happy Crunching!!

אין תגובות:

הוסף רשומת תגובה