Oracle® Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 2 (10.1.2) Part No. B15505-01 |
|
![]() Previous |
![]() Next |
To speed up the performance of your entity bean, you can configure two options for batching SQL statements, as follows:�
Batch SELECT statements: If you have more than one SELECT statement to execute, you can specify the number of rows to retrieve at a time with the prefetch-size attribute in the <finder-method> element. This attribute is documented fully in the 9.0.4. EJB documentation.�
Batch UPDATE statements: If you have several updates in a row (in executeUpdate), you can configure how many of these to batch together to go out to the database in one round trip in the batch-size attribute of the entity-deployment element. The default is no batching (size is 1). �To learn more about batching update statements, see the JDBC documentation for the Oracle 10g database.�
There is one exception to the batching size. If the code executes a SELECT statement within several UPDATE statements, the updates will be executed against the database before executing the select. This is done so that all updates are performed before you retrieve any data. If you know that it does not matter for this select to be performed, then you can stop the automatic flushing by specifying delay-updates-until-commit for the bean. �