Quote
Aleksandar Galovic wrote:
> When you open TTable, you are making permanent connection with a
> TTable.db file on a server side. If you use TQuery (without live result)
> , you are not making permanent connection. If it is like that, and you put
> UPS on the server, during power loss on a client side, you are not making
> any damage on the TTable.db file.
I'm not sure what you mean by permanent connection here. The connect is kind
of permanent during Insert/Edit phases, because these keep some records locked
on the server's hard disk.
If you get data from Paradox table without intending to update anything
there, then I would say it's exactly as safe to use TTable or TQuery for just
browsing the data.
Just browsing the data never writes any permanent or temporary data on the
server's hard disk. So, no matter if you switch off, or loose, the power from
your workstation in any phase here. The DB files and their indexes will stay
written and untouched on the server's hard disk.
The critical phase starts only when you start to Insert or Edit anything
on the server. Your code can have bad logic that corrupts your DB indexes,
or your BDE may be incorrectly configured in multi user environment, and
again you get the indexes smashed. Or you can loose the workstation power
in middle of writing the data, and the DB files on the server get only
partially written.
Roughly, the difference between A. Desktop databases (Paradox, dBase, Access
etc.) and B. Client/Server SQL databases (Interbase, Oracle etc.) is:
A. The workstation is the only part having any intelligence when reading or
writing any data to the server's DB files. There really are no parts of the
BDE loaded in to servers memory, nor does it have any kind of intelligent
cache to temporarily save the Paradox updates, nothing.
The server that keeps Paradox type databases is a 'dummy' server. Actually
it's only a shared hard disk, having the same amount of intelligence as your
workstations own hard disk has, and that ain't much.
Thus, all the writing and updating to the server's DB files breaks at the same
time as the workstation hangs, losses it's power etc.
B. The Client/Server databases do have an active process running on the server,
the Server part.
When the workstation wants to get some data, it kindly passes the SQL query to
this server process. The server process scans the SQL database, and returns the
wanted data.
Every update to the Client/Server database goes the same way. Client again sends
a kind request:
"Update Orders SET IntD="Y" Where Paydate <= DueDate"
Server process checks that the query is reasonable, and after that starts
to update the DB.
And *HERE* is also one of the big strengths of C/S database, you can quite safely
loose the power from your workstation in any phase. The Server process takes care,
that your update will always be written correctly and completely, or it won't be
written at all.
Quote
> Correct me if Im wrong:
Well, if I was badly wrong, someone probably will correct me:)
Markku Nevalainen