Transactions & Parent/Child objects.


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
I may be missing something, but saving objects with a parent child relationship under a transaction does seem to work properly. Attached is a simple example. It consists of one parent object with two child objects. When the three objects are saved outside of a transaction, everything works as expected. However when they are saved under a transaction, the framework saves the parent three times.

-Larry

Attachments
TranTest.zip (166 views, 759.00 KB)
Reply
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yeah, it will do that... the business objects still return IsDirty = True until TransactionCommitt is called (just in case you roll back the transaction).  So, when the child checks its parent, it will still be dirty and will think it needs to save again.  Hrm... I'll have to think about this one; might take me a little while.  I do have a collection of the DataTables that have participated in the transaction already, so I can probably test on that.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search