Subject RE: [Firebird-Java] Maximum number of items in batch
Author Rick DeBay
> The addBatch() method stores your parameters in collection (also if
you use BLOBs, their content is held in memory). In executeBatch() it
simply loops through the collection and executes each statement.

Does it allocate memory anywhere else? The OutOfMemory error happens
several seconds after entering executeBatch(). So the parameter List
has already been created, and Jaybird is only iterating through it.

-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Tuesday, March 15, 2005 3:29 PM
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] Maximum number of items in batch



> Is there an approximate number of items that may be executed in a
> PreparedStatement batch? I know it's less than 160,000 as that many
> items cause an OutOfMemory error somewhere inside executeBatch() :-)

Only your memory. The addBatch() method stores your parameters in
collection
(also if you use BLOBs, their content is held in memory). In
executeBatch()
it simply loops through the collection and executes each statement.
There is
no performance improvement in using executeBatch() compared to simple
executeUpdate(). The method is there only to provide a JDBC
compatibility
and to ease migration.

Roman




Yahoo! Groups Links