Subject AW: [Firebird-Java] jabird / Select / Update
Author Steffen Heil (Mailinglisten)
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?


> 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.

We are using this during updates of our software that change database
content.
So that very code is usually only run once during the lifetime of the
database.
While I am happy with every performance optimization, I need to go for every
stability optimization.
That's why I was afraid that the jaybird driver would queue something up
here.

We could have as few as 10 rows and as much as millions of rows.
The update for huge databases may take a while, but it may never break.


> Also, how complex is that modify() function ? can you re-write it in SQL
and run on server instead with single SQL statement?

We have several similar places that use code like the one posted.
One example is code that takes a plaintext password column and converts it
to linux-style sha512-salted-password hashes. While you can probably
implement sha512 within a stored procedure, we need to run that function
5000 times per plaintext password (which may be hundreds of thousands - and
we need to get finished in this century...


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.)
Apart from that, thanks for the tips.


Best regards,
Steffen



[Non-text portions of this message have been removed]