Conditional Validations ADF Server Performance

9-4 Oracle Fusion Middleware Performance and Tuning Guide Fetch Size The JDBC fetch size gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. For large queries that return a large number of objects, you can configure the row fetch size used in the query to improve performance by reducing the number database hits required to satisfy the selection criteria. See Also: Using EclipseLink JPA Extensions - Fetch Size at http:wiki.eclipse.orgUsing_ EclipseLink_JPA_Extensions_ELUGBind_ Parameters Most JDBC drivers use a default fetch size of 10. If you are reading 1000 objects, increasing the fetch size to 256 can significantly reduce the time required to fetch the querys results. Note: The default value means use the JDBC driver default value, which is typically 10 rows for the Oracle JDBC driver. To configure this, use query hint eclipselink.jdbc.fetch-size. Default Value: 0 The optimal fetch size is not always obvious. Usually, a fetch size of one half or one quarter of the total expected result size is optimal. Note that if you are unsure of the result set size, incorrectly setting a fetch size too large or too small can decrease performance. Batch Writing Batch writing can improve database performance by sending groups of INSERT, UPDATE, and DELETE statements to the database in a single transaction, rather than individually. The persistence property in persistence.xml eclipselink.jdbc.batch-writing=JDBC is used to configure this. See Also: How to Use Batch Writing for Optimization at http:wiki.eclipse.orgOptimizing_the_ EclipseLink_Application_ELUGHow_to_ Use_Batch_Writing_for_Optimizatio Default Value: Off Enable for the persistence unit. Change Tracking This is an optimization feature that lets you tune the way EclipseLink detects changes in an Entity. See Also: Using EclipseLink JPA Extensions for Tracking Changes at http:wiki.eclipse.orgUsing_ EclipseLink_JPA_Extensions_ ELUGUsing_EclipseLink_JPA_ Extensions_for_Tracking_Changes Default Value: AttributeLevel if using weaving Java EE default, otherwise Deferred. Leave at default AttributeLevel for best performance. Weaving Can disable through persistence.xml properties eclipselink.weaving Default Value: On Leave on for best performance. Table 9–1 Cont. EJBJPA Using Efficient SQL Statements and Querying Tuning Parameter Description Performance Notes Oracle TopLink EclipseLink JPA Performance Tuning 9-5

9.2.1 Entity Relationships Query Parameter Tuning

Table 9–2 shows the Entity relationship query parameters for performance tuning. Read Only Setting an EJB3.0 JPA Entity to read-only ensures that the entity cannot be modified and enables EclipseLink to optimize unit of work performance. Set through query hint eclipselink.read-only. Can also be set at entity level using ReadOnly class annotation. See Also: Using EclipseLink JPA Extensions - Read Only at http:wiki.eclipse.orgUsing_ EclipseLink_JPA_Extensions_ELUGRead_ OnlyUsing_EclipseLink_JPA_Extension Default Value: False For optimal performance use read-only on any query where the resulting objects are not changed. firstResult and maxRows These are JPA query properties that are used for paging large queries. Typically, these properties can be used when the entire result set of a query returning a large number of rows is not needed. For example, when a user scans the result set a page at a time looking for a particular result and then discards the rest of the data after the record is found. See Also: How to Use Result Set Pagination at http:wiki.eclipse.orgOptimizing_the_ EclipseLink_Application_ELUGHow_to_ Use_Result_Set_Pagination_for_ Optimization Use on queries that can have a large result set and only a subset of the objects is needed. Sequence number pre-allocation Sequence number pre-allocation enables a batch of ids to be queried from the database simultaneously in order to avoid accessing the database for an id on every insert. See Also: Sequencing and Pre-allocation Size at http:wiki.eclipse.orgOptimizing_the_ EclipseLink_Application_ ELUGSequence_Number_Preallocation Default Value: 50 Always use sequence number pre-allocation for best performance for inserts. SEQUENCE or TABLE sequencing should be used for optimal performance, not IDENTITY which does not allow pre-allocation. Table 9–1 Cont. EJBJPA Using Efficient SQL Statements and Querying Tuning Parameter Description Performance Notes 9-6 Oracle Fusion Middleware Performance and Tuning Guide Table 9–2 EJB3.0 Entity Relationship Query Performance Options Tuning Parameter Description Performance Notes Batch Reading The eclipselink.batch hint supplies EclipseLink with batching information so subsequent queries of related objects can be optimized in batches instead of being retrieved one-by-one or in one large joined read. Batching is only allowed on queries that have a single object in their select clause.The query hint to configure this is eclipselink.batch. See Also: EclipseLink Users Guide section Using EclipseLink JPA Extensions - Batch at http:wiki.eclipse.orgUsing_ EclipseLink_JPA_Extensions_ ELUGBatch Default Value: Off Use for queries of tables with columns mappings to table data you need.You should only use either batch-reading or joining if you know that you are going to access all of the data; if you do not intend to access the relationships, then just let indirection defer their loading. Batch reading is more efficient than joining because it avoids reading duplicate data; therefore for best performance for queries where batch reading is supported, consider using batch reading instead of join reading. Join Join reading is a query optimization feature that enables a single query for a class to return the data to build the instances of that class and its related objects. Use this feature to improve query performance by reducing database access. By default, relationships are not join-read: each relationship is fetched separately when accessed if you are using lazy-loading, or as a separate database query if you are not using lazy-loading. You can specify the use of join in JPQL JOIN FETCH, or you can set it multi-level in a query hint, eclipselink.join-fetch. It also can be set in the mapping annotation JoinFetch. Joining is part of the JPA specification, whereas batch reading is not. And, joining works on queries that not work with batch reading. For example, joining works on queries with multiple objects in the select clause, queries with a single result, and for cursors and firstmax results, whereas batch reading does not. See Also: Using EclipseLink JPA Extensions - Join Fetch at http:wiki.eclipse.orgUsing_ EclipseLink_JPA_Extensions_ ELUGJoin_Fetch Default Value: Not Used Use for queries of tables with columns mappings to table data you need.You should only use either batch-reading or joining if you know that you are going to access all of the data; if you do not intend to access the relationships, then just let indirection defer their loading.For the best performance of selects, where batch reading is not supported, a join is recommended