User Interface | SmartSync | GenericSync | Persistence | Trace | General Programming Tips
Recommendation |
Description |
Use SyncBoReplyObserver instead of registering to SyncBoInDeltaObserver. | When using SyncBoInDeltaObserver instances,
every inbound delta has to be instantiated as an Object that holds
all fields as value objects. Therefore the data cannot be passed on to persistence
layer in the faster stream-based mode. A more performant solution to get conflict messages of the backend-processing of a SyncBoDelta is to setup a SyncBoReplyObserver for SyncReplyType.ERROR / SyncReplyType.CONFLICT / SyncReplyType.TECHNICAL. |
Do not use untyped read. | An untyped read forces SmartSync to look in all relevant persistence tables for an entity with the specified key. Example for an untyped read: SyncBo.getRow(String); SyncBoDataFacade.getSyncBo(String); SyncBoDataFacade.getRow(String); Performance improvement using RowDescriptor: SyncBo.getRow(RowDescriptor,BigInteger); SyncBoDataFacade.getSyncBo(SyncBoDescriptor, BigInteger); SyncBoDataFacade.getRow(RowDescriptor, BigInteger); SyncBo.getRow(RowDescriptor,String); SyncBoDataFacade.getSyncBo(SyncBoDescriptor, String); SyncBoDataFacade.getRow(RowDescriptor, String); |
Use values > 18 digits only when absolutely necessary. | Complex numeric values need more resources. The decision about the precision of the numeric values has to be done at the design time of the BAPI wrappers. |
Use Row.modifyFieldValue(Object) instead of Row.setFieldValue(). | Everytime the Row.setFieldValue()
method is called, a full DB-update with transaction commit is
performed. Row.modifyFieldValue(Object) modifies a single field without causing a DB-operation. SyncBo.modifyRow(Row)finally makes the DB update for all changes. For further information, please look at the coding example. |
Use type specific methods to get field values. | The Row.getFieldValue(FieldDescriptor)
/ Row.getFieldValues() methods instantiate and return value Objects,
according to the “old” mapping model, such as N>String,
P>FixedDecimal and D,T>Calendar. Use the methods Row.getCharacterField(), Row.getDateField(),
Row.getDecimalField(), Row.getNumericField(), Row.getTimeField()
to get the field value. |
Use SyncBoDataFacade.getRows(Query) / SyncBoDataFacade.getSyncBos(Query) before using SyncBoDataFacade.size(Query) |
The SyncBoDataFacade.size(Query) method
scans the entire database-table. This operation does not need so many resources
as an query operation because no result set is created. If however, a query operation has to be done anyway, it saves resoures when you invoke the query first and than call the size() method. |
Avoid Query condition where possible | Queries are resource consuming. Check if different cases can really occur, based to the data definition in the backend. Try to convert user input strings to uppercase or lowercase and make one query. Example - Query to find a part number:
|
Request only entries you want to display | Use the SmartSync API to get the entries you want to display (defined by starting index and number of entries), instead of getting all entries and iterating yourself. We recommend the following:
|
Applications must handle synchronization at any time. | Synchronization is a framework-driven process. Synchronization will be started when a network connection is available, the user chooses the synchronization button and all transactions on the client are closed.. The application must handle a synchronization at any time. |