Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread InTransaction?
Thu, Nov 20 2008 5:05 AMPermanent Link

Tiago Ameller
Table A has
 Detail Table(s) B has
   Detail Table(s) C

In TableA_BeforeDelete I start a restricted transaction to cascade delete rows in B tables.
In TableB_BeforeDelete I start a restricted transaction to cascade delete rows in C tables.

The problem is in TableB_BeforeDelete I can't know there is already an active transaction (same thing as InTransaction at TEDBDatabase
component). Since rows in Table(s) C can be deleted due both TableA or TableB row deletion, how can be it done?

Thanks!
Thu, Nov 20 2008 7:14 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tiago


Can rows in table B be deleted without deleting rows in table A and can rows in table C be deleted without deleting rows in table B?

Roy Lambert [Team Elevate]
Thu, Nov 20 2008 1:10 PMPermanent Link

Tiago Ameller
Roy,

>Can rows in table B be deleted without deleting rows in table A and can rows in table C be deleted without deleting rows in table B?

It's a true cascade. If you delete A then B and C must be deleted. If you delete B then C must be deleted. If you delete C then nothing more
occurs. And of course, deleting B don't affects A and deleting C don't affects A nor B.
Thu, Nov 20 2008 1:15 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

<< The problem is in TableB_BeforeDelete I can't know there is already an
active transaction (same thing as InTransaction at TEDBDatabase component).
Since rows in Table(s) C can be deleted due both TableA or TableB row
deletion, how can be it done? >>

Right now you have to attempt the START TRANSACTION and catch the exception
using an EXCEPTION block.  I've got an INTRANSACTION() function on the list
for 2.03 to resolve this.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Nov 20 2008 1:45 PMPermanent Link

Tiago Ameller
Tim,

<<  I've got an INTRANSACTION() function on the list
for 2.03 to resolve this.>>

This will definitely be the solution!

--
Tim Young
Elevate Software
www.elevatesoft.com
Image