Subject RE: [IBO] RE: help
Author Gerald W. McCaig - Efi Soft
Hi Lester,

Thanks for your input. Actually, the transactions are handling separate
records. And, I am in a way trying to nest the transactions, but maybe not
in the way you have perceived. Let me detail what I am doing a little
further and maybe you can tell me the best way to cancel/delete the DETAIL
record...

Append Invoice Query ... Invoice #15001 {Start a new Invoice - MASTER}

Append Item Query ... Item #1001 {Add a new Line Item to the Invoice -
DETAIL}
Append Item Query ... Item #1002 {Add a new Line Item to the Invoice -
DETAIL}
Append Item Query ... Item #1003 {Add a new Line Item to the Invoice -
DETAIL}
Append Item Query ... Item #1004 {Add a new Line Item to the Invoice -
DETAIL}

Example: Before Applying the Updates (Query.ApplyUpdates) I noticed that I
made a mistake and need to cancel Item #1004 before I complete it. Right now
I am calling DETAIL.CancelUpdates to handle this, but when I commit the
transaction it still saves Item #1004.

Also, let's say I want to Delete Item #1002. What should I call so that when
I commit the transaction this is not recorded?

The reason I am not committing each DETAIL Item, is because I need the
flexibility of rolling them back in case the user decides to Cancel the
Invoice (MASTER).

Can you let me know what to call to cancel a current append and delete an
existing item ... both members of the Item Query (DETAIL)?

Thanks in advance for all of your help.

Jerry




-----Original Message-----
From: lester@... [mailto:lester@...]
Sent: Wednesday, February 27, 2002 3:56 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] RE: help


> I guess I am used to the MIDAS way, where you need a transaction for every
> Query/Table. Also, I like to have more control over what is happening, and
> that is why I have used two transactions. Is there a downside to doing
this?
> I have always been told multiple transactions keep a tighter control over
> what is going on, by separating your actions.

This will only work if the transactions are handling
separate records - see below.

> Anyway, bottomline, I need to know how to cancel and delete items in the
> DETAIL, without compromising my ability to roll everything back if the
user
> decides to cancel the MASTER.

I have a similar problem. I use the transaction for the
outer wrapper, i.e. all updates, so that rolling back the
MASTER clears everything. The problem is that you can't
'nest' transactions, so each DETAIL item has to be deleted
rather than rolling back a second transaction. In my case,
it is usually the case that a problem with a detail means
the whole order was to be cancelled anyway, until stock is
available to complete the whole order, but each detail item
can be changed to select a different batch code, or cancel
it. It just requires care when setting up your 'work flow'.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services


___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/