On Tuesday 15 June 2004 19:38, you wrote:
> It is unclear what the differences here are. You haven't shown the
> Statement creation and/or execution, so it's possible that you haven't
> used setFetchSize or you've specified a scrollable ResultSet. Maybe auto
> commit is on. Any of these will cause a cursor not to be used and the
> results will be fetched in bulk, so an intermediate commit won't cause any
> problems. Maybe the query doesn't retrieve 100 rows, so it doesn't get to
> the commit part.
And why doesn't this work:
db.setAutoCommit(false);
final Statement select =
db.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT,
ResultSet.CONCUR_READ_ONLY);
select.setFetchSize( Configuration.FETCH_SIZE );
int i = 0;
for( final ResultSet row = select.executeQuery( sql ); row.next(); i++)
{
...
insert.execute();
continue;
if (i%100==0) db.commit();
}
BTW ResultSet.TYPE_SCROLL_INSENSITIVE doesn't work either :-(