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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transactional behavior is puzzling

Status
Not open for further replies.

JeffTSG

Programmer
Jan 2, 2001
1
US
In one package, I have tried to isolate d/b activity of a component (#B) by setting it to "requires new tx". It is invoked by a master component (#A) that is set to "requires tx." I get Distributed TX errors and I'm hoping someone can tell me why!?

If I change #B to 'no tx' support, it can add a new record, but times out when updating a record. This is also is puzzling.

MTS is on one machine and SQL 6.5 on another.

Thanks,
 
Hi Jeff,

you can find MTS SPY here
When you use #A the registers in DB became locked. When you invoke #B and try to use the same registers, you receive an error, because #A haven't done commit on those registers.

I think that's the reason that you can make insert's but not updates.

The settings are correct, I have components working with those settings.

regards,

Bruno Loureiro
<brunoloureiro@usa.net>
 
I think B should be set to 'Supports transactions' or Requires New' since it is the 'child' and A to 'Requires New' or 'Requires a transaction' since it is the 'Parent'.

EjL
 
Hi Mr. E,

if you set #B to 'Supports Transactions', it will be running in the same transaction as #A, so the commit will only be done when #A commits.

If #B is set to 'Requires New Transaction' and #A to 'Requires New Transaction' or 'Requires Transaction', then if #A does an Insert into the table tbSample and #B tries to update that same record, it will raise an error, because #A hasn't commited (the record is locked). The same thing will happen if #A does an Insert into tbSample.id and #B tries to insert into tbSample2.id, that is FK of tbSample.id, because the record in tbSample is locked (#A hasn't commited).

regards,

Bruno Loureiro
<brunoloureiro@usa.net>
 
BML is correct. If you run B in the same transaction as A
this should work.

If not, do the above, and, set your isolation level to READ COMMITTED, then you should be able to do this...
Tom Davis
tdavis@sark.com
 
Please read the FAQ I have posted in this forum (faq330-397). Also, there is a great book that you can read to learn more about this by Ted Pattision, entitled &quot;Programming Distributed Applications with COM and Microsoft Visual Basic 6.0&quot;.

Chapters 9 and 10 of this book should provide you with the details needed to clear up this fuzzy issue... (no pun on policitics intended). Tom Davis
tdavis@sark.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top