Using JSDOs to create mobile and web clients : JSDO overview : Asynchronous and synchronous execution : Comparing asynchronous and synchronous execution
  
Comparing asynchronous and synchronous execution
Asynchronous execution is mandatory for the methods that execute the standard Data Object CRUD and Submit operations. These operations usually involve server access to data sources, which are typically databases. The Data Object Read operation executed by the fill( ) method can involve reading and returning hundreds to thousands (or more) records from a multi-table resource across the network. The Data Object Create, Update, Delete (CUD), and Submit operations, which require writes to, and lock management of, databases, are executed across the network by the saveChanges( ) method one record at a time for CUD operations and multiple records at a time for the Submit operation, and for as many records as are marked changed in JSDO memory.
This means that completion of these operations can require detectable wait times. If they were executed synchronously, the mobile app user would be prevented from doing any work within the app while these methods are executing. With asynchronous execution, they can perform other tasks, such as setting application options, while waiting for a list of customers and orders, for example, to be displayed in a list view, or while waiting for notification that changes they have posted have been saved to the database. For more information on the execution options for methods that execute the standard Data Object CRUD and Submit operations, see Accessing standard CRUD and Submit operations.
Asynchronous execution is also the default for custom invocation methods, again, because these operations execute across the network and can involve complex database interactions on the server. However, it is also possible that an invocation method might perform a simple function and return a primitive value used in an expression—for example, a percentage or a credit limit. In this case, you might prefer to execute the method synchronously in the expression in order to complete the calculation with its return value. This you can do by passing false as an additional boolean parameter that indicates that the invocation method is to be executed synchronously. For more information on the execution options for invocation methods, see Accessing custom Invoke operations.