
VB and nested SQL Server 7 transactions-- possible?
I've got a business object in VB (let's call it "component A") whose
transaction attributes are set "Requires New". From it, I create
sub-components whose transactions are set to "Requires", and everything
works great. If one of the sub-components throws an error while writing to
SQL Server, the transaction is rolled back no problem.
Now, a situation has come up where I'd like to create another sub-component
(call it "component B") from within component A. Thing is, component B also
has it's transaction attributes set to "Requires New". It does basically
what component A does-- creates child components whose transactional
attributes are set to "Requires", etc.
Component B usually stands alone, like component A, but a situation has come
up where it would be very nice to have "A" create an instance of "B" and
have "B" do it's thing. Sorry for the confusing notation here.
The question I have is, can I nest these transactions in Visual Basic? If
component B's transaction is rolled back, will it also roll back component
A's transaction? Or are things such that the two transactions are
completely separate, and just forget about tying them in together, 'cause it
isn't possible? I've never tried it before, and was wondering what the
rules might be, if I'm setting myself up for trouble here. Thanks for any
and all advice.