Re:CachedUpdates
Quote
> Delphi writes to the Paradox table only when you say ApplyUpdates, not
> before. At that time, it puts the added records into the Paradox table
> one at a time. You get to review this process if you want to in
> OnUpdateRecord where you get a second chance to fix problems, skip
> updates and do other maintenance. OnUpdateRecord is not required,
> however.
Hi Phil,
(this should probably be a thread of its own, but hey...)
(and my apologies for the length of this post)
Speaking of cached updates, perhaps you can shed some light
on something for me. I have a few people that are using my
app in a LAN environment, e.g., the database tables are
stored on a server. For direct table access, I've managed
to keep them from stepping on each others toes by locking
the required tables (note: table-level lock, not record-
level lock) prior to writing and releasing the lock after
the Post (this works like a champ).
But...
I have a few grids that are based on rather complex queries
so I'm using cached updates to handle record updates to one
particular table. Apparently, the record locking mechanism
is quite different for queries than it is for tables, and
so I get reports of corrupt indexes from time to time due
to what I presume is some kind of simultaneous access problem.
I'd considered playing some games on ApplyUpdate -- the idea
was to cancel the update (i.e., don't execute the update SQL
statement), and then do the update directly to the table in
code. The problem with that approach is, short of closing and
re-opening the query, there's no way to convey the update
back to the dataset.
So the question is, can I gain a table-level lock when I'm
doing an update query? Local SQL seems to be a bit short-
handed with that kind of functionality, but I'm hoping there's
a way to ensure exclusivity when I'm doing an update via SQL.
Your thoughts would be appreciated!
Thanks...
Chris W.