MTS Transactions Questions 
Author Message
 MTS Transactions Questions

Hello,

Trying to understand tarnsactions Under MTS / Com+

If I Understand this, one approach to doing transactions is to write a
bunch of small granular methods and mark them "Uses Transactions". Like

M1 Insert into database
M2 Update database
M3 delete from database
M4.Insert into database

Then you write a component that uses these granular methods within the
MTS Context to do some sort of business stuff and mark it as "requires a
transaction" Like

Bus1

do stuff
m1.execute
if ok then setcomplete else setabort
do stuff
m2.execute
if ok then setcomplete else setabort

Is this close of have I missed the boat.
Thanks

Scott



Fri, 27 Sep 2002 03:00:00 GMT  
 MTS Transactions Questions
Hi scott,

the approach i usually use is:

on error goto errorhandler
M1 insert
errorhandler: RAISE error

on error goto errorhandler
M2 update
errorhandler: RAISE error

all of these data components are marked 'supports transactions' and have the
standard errorhandler that simply Raises an error

then you have bus1

Bus1

On error goto errorrhandler
M1 execute
M2 execute
Setcomplete

Errorhandler: setabort

This one is indeed marked 'requires transactions'.  You don't need to check
after each individual statement, since they're part of the same transaction
and the Raised error from your DB component will 'bubble up' to the BUS
errorhandler, which will call Setabort, thus flagging the tranaction as
aborted.

clean and simple :)

cheers

Sam Goutsmit


Quote:
> Hello,

> Trying to understand tarnsactions Under MTS / Com+

> If I Understand this, one approach to doing transactions is to write a
> bunch of small granular methods and mark them "Uses Transactions". Like

> M1 Insert into database
> M2 Update database
> M3 delete from database
> M4.Insert into database

> Then you write a component that uses these granular methods within the
> MTS Context to do some sort of business stuff and mark it as "requires a
> transaction" Like

> Bus1

> do stuff
> m1.execute
> if ok then setcomplete else setabort
> do stuff
> m2.execute
> if ok then setcomplete else setabort

> Is this close of have I missed the boat.
> Thanks

> Scott



Tue, 01 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. When to use MTS transactions and ADO Transactions

2. To Transaction or Not to Transaction that is the question

3. How to use MTS Style Transactions in VB.Net

4. MTS - Microsoft Transaction Server

5. MTS Microsoft Transaction Server

6. Enlisting VBScript in an MTS/COM+ transaction

7. What is an MTS Transaction?

8. Migration MTS projects to 2000, Old References to Transaction Server Type Library

9. Access and MTS and Transactions

10. MTS, ASP Pages and Transactions

11. Single transaction without MTS

12. Single transaction without MTS

 

 
Powered by phpBB® Forum Software