fetch_size is a JDBC configuration property applied to com.sql.Statement. From the Statement java doc:
Quote:
void setFetchSize(int rows) throws SQLException
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 ResultSet objects genrated by this Statement. If the value specified is zero, then the hint is ignored. The default value is zero.
Parameters:
rows - the number of rows to fetch
Batch size is a hibernate configuration property not a JDBC property. It can be applied to entities or collections. When configured, hibernate will fetch multiple uninitialised proxies in a single statement. This can be used to improve performance.
e.g.
I have a Company object that contains a set of Employees. Employee contains a Person object and a Role object. Lets say I load a company and navigate to its employees. Hibernate creates a proxy for each of the Person objects in the loaded employees. If I have 10 employees and iterate over them to print their names, 10 select statements will be issued to initialise the 10 Person proxies that were created. If I set a batch-size="10" on Person, hibernate will initialise all 10 proxies in one go with a single select statement.