با اجازه بزرگترا
Transaction در هر حالتی که با دیتا بیس (اوراکل و اسکیو ال سرور)کار می کنیم وجود دارند ولی ما متوجه کار آن نمی شویم چون به صورت ضمنی و خودکار اجرا می شوند ولی با این حال ما می توانیم کار آنها را به دست گرفته و خودمان کنترلشان کنیم که در همه کتابهای اوراکل و اسکیو ال سرور توضیحاتی داده است کار اصلی ترانزکشن پاپین آوردن ترافیک شبکه است و همچنین مواردی که ما می خواهیم مجموعه کار ها با هم ذخیره شوند یا اصلا ذخیره نشوند مثل همین مورد دوستمان . آیا این دقیقا کاری نیست که شما می خواهید انجام دهید؟
ولی دلفی خود نوعی ترانزکشن دارد که با true کردن CachedUpdates در TTable امکان پذیر است و دو تابع اصلی مرتبط با آن ApplyUpdates و CancelUpdates هستند
به توضیحات help دلفی در مورد CachedUpdates نگاه کنید
Specifies whether cached updates are enabled for a dataset.
property CachedUpdates: Boolean;
Description
CachedUpdates enables or disables the use of cached updates for a dataset. If CachedUpdates is True, cached updates are enabled. If CachedUpdates is False, cached updates are disabled.
When cached updates are enabled, updates to a dataset (such as posting changes, inserting new records, or deleting records), are stored in an internal cache on the client machine instead of being written directly to the dataset’s underlying database tables. When changes are complete, an application writes all cached changes to the database in the context of a single transaction.
Cached updates are most useful to client applications in two-tiered applications. The main benefits of enabling cached updates are:
Fewer transactions and shorter transaction times.
Minimization of network traffic.
The potential drawbacks of enabling cached updates are:
Other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database.
Other applications cannot access data changes made by an application until its cached updates are applied to the database.
Note: Instead of using cached updates, applications can obtain the same benefits with greater control by using a client dataset and a provider component.
Note: When cached updates are enabled, data changes are stored in local memory. The storage medium is a Paradox format in-memory table. This has implications for applications run in a network environment in that the NET DIR parameter for the Borland Database Engine (BDE) driver for Paradox needs to be set -- even though the application may be designed to use other database types. Failure to properly set this parameter can result in an EDBEngineError exception. There are two ways to set NET DIR. One is through the BDE configuration utility BDE Administrator (described in the BDE Administrator online help). The other way is through the TSession.NetFileDir property.
موفق باشید