Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

control transaction manually

Status
Not open for further replies.

zallen

Programmer
Aug 10, 2000
227
0
0
CN
Hi,friends
Ordinarily we set a MTS object's transaction property by using MTS explorer.Here what i want to know is that whether or not i can set it in component's method.For example i have a MTS component named Proj.DO which has two method:get_data,set_data.
The get_data only fetches records from SQL server and the set_data insert/update records to SQL server.In get_data it doesnot need transaction,in set_data it requires transaction.How can i do it?

Any suggestions are appreciated!
zallen@cmmail.com
Long live of freedom!
 
You can set your transaction level inside ADO. But MTS will not know anything about it, so if you're doing any sort of cross-database transaction (or database-to-MSMQ transaction) you'll be in trouble.

What we've done is create two classes -- one for all our transactional requests, and one for simple data retrieval. We just set the MTS property on each appropiately.

Chip H.
 
Thanks for your response! But now we cannot put get_xxx and set_xxx methods into different classes because in our rational rose model the two methods are belonging to one class.

Regards! zallen@cmmail.com
Long live of freedom!
 
I think if you keep your both the methods in one dll and on MTS with Supported transaction property.

This may work if you are going to create saperate instance for each method. In this case your getdata wont be in any transaction and setdata can be in the transaction whenever it is required(As they would run under different instance).





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top