I've had a relatively quiet few days so have been using them to try to catch up with various stuff. However things are warming up again so I anticipate that I will have to drop everything: as such, this is where I'm at.
The attached test program assumes the existence of a PostgreSQL server, but should be trivially modifiable for others. Assuming a R/W table in a suitable database, it sets up a DB-aware grid and allows records to be added/deleted, there is an operation button to force a commit or rollback. All of this works provided that the connection is kept live.
If the operation button is used to glitch the connection briefly, operation appears to continue. I've not investigated how tolerant this is to e.g. forced TCP session interruption.
If it is run on a laptop which is put to sleep, then after some interval the server will time-out the connection: there is no mechanism to reinstate it when the laptop is woken. At this point the test program will accept modifications to the grid, but attempting to commit the transaction will fail.
If, from the POV of the Postgres server, the client IP address changes, I would expect that to similarly result in a transaction failure. That also includes the situation where the link between the client and server is NATted and the connection tracking is interrupted for some reason.
This brings me back to the position that the naive RAD approach of plonking a DB-aware grid onto a form and expecting it to work is inadequate.
There might be ways of recovering from this and reestablishing the connection, even if the client IP address changes, but I have seen no coherent discussion of this. In any event, this would be unable to reinstate the state of the failed transaction, with the result that the content of the table (on the server) and DB-aware visual controls (on the client) would have to be assumed to be inconsistent.
In addition, I can find very little coherent information on specifying transaction isolation level using the standard components: there's some level of support for FireBird, but not for others.
So to summarise, one has to be extremely cautious and defensive when talking to a (remote) database, and while it's possible to use classic SQL techniques to handle individual rows any attempt to edit a table using a grid is risky.
Updated to add: the version of the program I posted monitors the DB controls' status. Rerunning the test suggests that the server-side timeout is of the order of three hours (with default server settings), the failure triggered an exception on the client reporting a TPQConnection preparation error, but there is no indication of this in the state of the controls (i.e.whether anything has been marked closed etc.).
My setup here has a laptop with WiFi to a local desktop system with DHCP etc., which NATs the connection to the database server. As such it's very similar to a domestic installation where the ISP doesn't guarantee stable IP allocation, or can introduce various connection tracking glitches (potentially destroying the connection-oriented TCP session).
If the connection was, in fact, permanently up (i.e. but with a very long-running query) then I anticipate that there would be various stay-alive traffic; in extremis something on the server could send notification messages (supported by controls for Postgres and FireBird, I believe that at least some other servers have something comparable at the API level). However I really cannot see any defence against the client IP address changing: the only people who could even start to address this would be the ones working on pgPool etc.
MarkMLl