Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 15 total
Thread CachedUpdates with m/d
Sun, Jul 23 2006 5:28 AMPermanent Link

"Sorin"
from an old message i figure that when activating beginCachedUpdates
the m/d relation is disabled so on the detail table on the afterOpen event
i have declared :
BeginCachedUpdates;
MasterSource := mainDatasource;
MasterFields :='mainId';
but still the m/d relation isn't enabled
thanks sorin

Sun, Jul 23 2006 6:34 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< from an old message i figure that when activating beginCachedUpdates the
m/d relation is disabled so on the detail table on the afterOpen event i
have declared :
BeginCachedUpdates;
MasterSource := mainDatasource;
MasterFields :='mainId';
but still the m/d relation isn't enabled >>

Cached updates are static and do not change until you call
ApplyCachedUpdates or CancelCachedUpdates, regardless of whether you have a
master-detail relationship, a range, or a filter defined on the table.  In
all cases, you're simply setting a range or filtering the cached updates
dataset, not the actual live table.

--
Tim Young
Elevate Software
www.elevatesoft.com

Sun, Jul 23 2006 10:50 AMPermanent Link

"Sorin"
Thanks but I don't figure out what to do
Basically this is a simple module that I try to convert from D2006 BDE
application
It has a main table and a related detail table witch i open on cache mode.
The user can append one record on the main table and several records on the
detail
and post them with transaction and applyupdates or open both for editing.
I don't use any range or filters on the bde version.
What are the differences on the dbisam version?
sorin

>
> Cached updates are static and do not change until you call
> ApplyCachedUpdates or CancelCachedUpdates, regardless of whether you have
> a master-detail relationship, a range, or a filter defined on the table.
> In all cases, you're simply setting a range or filtering the cached
> updates dataset, not the actual live table.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Sun, Jul 23 2006 10:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< It has a main table and a related detail table witch i open on cache
mode. The user can append one record on the main table and several records
on the detail and post them with transaction and applyupdates or open both
for editing. I don't use any range or filters on the bde version.What are
the differences on the dbisam version? >>

With the BDE, cached updates are table-wide, meaning that you can change
ranges (M/D), filters, etc. while the cached updates are in effect. With
DBISAM, cached updates are simply an in-memory copy of the current dataset
as of the time the BeginCachedUpdates method is called.  Also, when cached
updates are in effect, all existing ranges or filters are removed and any
subsequent ranges and filters only apply to the cached dataset, not the
actual underlying dataset.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jul 24 2006 7:15 AMPermanent Link

"Sorin"
> With the BDE, cached updates are table-wide, meaning that you can change
> ranges (M/D), filters, etc. while the cached updates are in effect. With
> DBISAM, cached updates are simply an in-memory copy of the current dataset
> as of the time the BeginCachedUpdates method is called.  Also, when cached
> updates are in effect, all existing ranges or filters are removed and any
> subsequent ranges and filters only apply to the cached dataset, not the
> actual underlying dataset.

Can you direct me to a demo of m/d with cached?

Mon, Jul 24 2006 8:18 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< Can you direct me to a demo of m/d with cached?  >>

There's one here:

http://www.elevatesoft.com/scripts/newsgrp.dll?action=openmsg&group=5&msg=52902&page=1#msg52902

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jul 25 2006 11:26 AMPermanent Link

"Sorin"
> http://www.elevatesoft.com/scripts/newsgrp.dll?action=openmsg&group=5&msg=52902&page=1#msg52902

Thanks Tim
I saw the demo but I can't implement it on my application.

On my app. I need to create an Invoice saved on 2 tables.
One table include the main invoice fields (No. date, total...) and
the second table the invoice items and sum per item. The 2 tables
have a m/d relation. All I need are 2 options
One is to append one invoice and several items and then save them all
together.
Second is to set an existed invoice and her details on edit mode to allow
required
modification and again saving the 2 tables.

On my BDE app I achieve it by simply putting the tables on cache mode
Can I do the same with dbisam or do i need a different approach?
Sorin


Wed, Jul 26 2006 12:25 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< I saw the demo but I can't implement it on my application. >>

It isn't intended to be put into your application.  It is intended to
demonstrate how to use cached updates in a master-detail link.

<< On my app. I need to create an Invoice saved on 2 tables. One table
include the main invoice fields (No. date, total...) and the second table
the invoice items and sum per item. The 2 tables have a m/d relation. All I
need are 2 options One is to append one invoice and several items and then
save them all  together. Second is to set an existed invoice and her details
on edit mode to allow  required
modification and again saving the 2 tables.

On my BDE app I achieve it by simply putting the tables on cache mode Can I
do the same with dbisam or do i need a different approach? >>

As demonstrated in the example that I linked to, you only need to put the
detail side of the master-detail link into cached updates mode.  The master
record is always buffered when in insert or edit mode, thus you don't need
to use cached updates with it.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jul 26 2006 6:54 AMPermanent Link

"Sorin"
> As demonstrated in the example that I linked to, you only need to put the
> detail side of the master-detail link into cached updates mode.  The
> master record is always buffered when in insert or edit mode, thus you
> don't need to use cached updates with it.

Thanks again
absolutely, I only call the BeginCacheUpdate to the detail table and i
encounters 2 problems.
The first invoice is saved ok The second one raise a key violation error on
the primary key
(the second table has an autoinc field as primary key besides the invoiceNo
field
i use for the m/d relation)
The second problem is when I open and old invoice on edit mode I can not see
the details
from the second table. I try to reestablished the m/d relation after the
begincacheupdate,
as on your example but it doesn't help.
Sorin



Thu, Jul 27 2006 10:44 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< absolutely, I only call the BeginCacheUpdate to the detail table and i
encounters 2 problems. The first invoice is saved ok The second one raise a
key violation error on the primary key (the second table has an autoinc
field as primary key besides the invoiceNo field >>

Are you calling ApplyCachedUpdates at any time ?  You have to call either
ApplyCachedUpdates or CancelCachedUpdates to stop the cached updates when
moving between the master records without posting (CancelCachedUpdates), or
when posting an invoice (ApplyCachedUpdates).

The demo application that I linked to shows how this is done.

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image