Subject Re: AW: [Firebird-Java] jabird / Select / Update
Author Mark Rotteveel
On 20-11-2012 22:08, Steffen Heil (Mailinglisten) wrote:
> Hi
>
>
>> At the moment you call updateRow(), Jaybird will execute a query to update
>> that row in Firebird (see the code in org.firebirdsql.jdbc.FBRowUpdater )
>
> But that happens "in place", so nothing is queue or such?

No, it happens immediately without queueing.

>> You could go with the suggestion by the_a_rioch earlier today to use two
>> 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.
>
> While I understand the idea, that is not a way I can go.
> I need to atomically update ALL rows of a table or NONE.
> If it IS really a difference, I could do my own update statement though.

That is what transactions are for. It doesn't matter if you use the
ResultSet to update it or two separate statements from the same
connection: if you disable autocommit, then it will be atomic. Below the
surface, the ResultSet actually uses a separate statement to execute the
updates, so there is no real difference between letting the ResultSet
handle it, or doing it yourself.

> So, if I understood correctly, nothing is queued and I can expect the
> pseudo-code I posted to work. (If I am wrong here, please correct me.)

Yes, that is how it works.

--
Mark Rotteveel