Subject | Re: [Firebird-Java] jabird / Select / Update |
---|---|
Author | Mark Rotteveel |
Post date | 2012-11-20T14:57:21Z |
On 19-11-2012 16:54, Steffen Heil (Mailinglisten) wrote:
update that row in Firebird (see the code in
org.firebirdsql.jdbc.FBRowUpdater )
separate (Prepared)Statement objects. It is slightly more work for you,
but it replaces the heuristics of the driver to update the right row
with an explicit query. Although performance and memory wise it will
probably not make a lot of difference.
Mark
--
Mark Rotteveel
> HiAt the moment you call updateRow(), Jaybird will execute a query to
>
> We are updating a (possibly) huge table with a statement like this:
>
> Statement statement = connection.createStatement(
> java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,
> java.sql.ResultSet.CONCUR_UPDATABLE );
> ResultSet data = statement.executeQuery( "select id, q from t where q is not
> null" );
> while ( data.next() ) {
> String q = data.getString( 2 );
> data.updateString( 2, modify( q ) );
> data.updateRow();
> }
> data.close();
> statement.close();
>
> Now I need to be sure, that those changes are done during that loop and are
> not cached by jaybird and executed afterwards.
> Because there may be much more entries that available memory.
update that row in Firebird (see the code in
org.firebirdsql.jdbc.FBRowUpdater )
> If there is any way to optimize that loops behavior, feel free to comment.You could go with the suggestion by the_a_rioch earlier today to use two
> (id is the primary key of that table, q in the example is a varchar(200).)
separate (Prepared)Statement objects. It is slightly more work for you,
but it replaces the heuristics of the driver to update the right row
with an explicit query. Although performance and memory wise it will
probably not make a lot of difference.
Mark
--
Mark Rotteveel