Subject | Re: AW: [Firebird-Java] jabird / Select / Update |
---|---|
Author | Mark Rotteveel |
Post date | 2012-11-21T15:12:09Z |
On 20-11-2012 22:08, Steffen Heil (Mailinglisten) wrote:
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.
--
Mark Rotteveel
> HiNo, it happens immediately without queueing.
>
>
>> 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?
>> You could go with the suggestion by the_a_rioch earlier today to use twoThat is what transactions are for. It doesn't matter if you use the
>> 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.
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 theYes, that is how it works.
> pseudo-code I posted to work. (If I am wrong here, please correct me.)
--
Mark Rotteveel