Subject Re: Problem with SELECT Statement
Author Roman Rokytskyy
Hi,

> If I run the code below I get the following output (First lines
> ommited):
>
> ..................................................350
> .................................................Error during
> Transform.Contacts...
> GDS Exception. Dynamic SQL Error
> SQL error code = -504
> Cursor unknown
> Error Code: 335544569
> SQL State: null

You get this because of conn.commit() in while(rs.netx()) statement.
Committing the transaction closes all associated statements and result
sets (see JDBC specs). This also releases the cursor. In the future
JayBird will complain more clear if you try to use closed result set.

> If I comment the autocommit and commit statements I get an out of
> memory message. If I add a first statement I can open the SELECT for
> the first 70'000 records, if I put a higher number I get the
> following output:

In autocommit mode (default) all data are fetched to the client. This
means that JayBird tries to load your 250,000 into memory.

> Task Manager tells me that I have more than 750 MB available memory.

It does not matter. You have to specify maximum memory for JVM using
-Xmx option (use "java -X" for more information). Default value was 64
MB, I do not know if it was changed in 1.4.2.

Best regards,
Roman Rokytskyy