﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Question about Transactions and ParentRecords...</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 04:08:03 GMT</lastBuildDate><ttl>20</ttl><item><title>Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost9086.aspx</link><description>I have a set of parent-child-grandchild-greatgrandchild-greatgreatgrandchild &amp;nbsp;etc tables.&amp;nbsp; Each of these levels have a cost, and the cost is determined from the bottom level child table.&amp;nbsp; I have in place some code on the BusinessObject AfterSave event, to grab the Child record that got saved, parent record, then grab all of its children to determine its new cost (such as changing a quantity etc). When this parent saves, it's new total gets rolled up to its parent in the same manner, an AfterSave event on the BusinessObject, and so on and so on untill we get to the top child, in which we calculate the new totals for the Top level, and call a method to refresh its data without reloading its DataTable (that was interesting :) ).&lt;P&gt;The Problem I'm running into is when Im Importing all of the Data in this Parent-Child-grandchild etc into the database with a transaction.&amp;nbsp; I would like to be able to save all of these BusinessObject's with a transaction, and then Commit or Rollback when Im done.&amp;nbsp; The problem is on the AFterSave of the first child record.&amp;nbsp; It's AfterSave event, and when it tries to read its Parent record, it just hangs because that record has not been committed in the transaction.&amp;nbsp; If I turn off transactional saving, it works fine, I just lack the transactional support.&lt;/P&gt;&lt;P&gt;Is there an easy way around this, Or is my methodology of what I'm doing just wrong?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Have a good Memorial Day Weekend Guys.&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Mon, 13 Aug 2007 14:44:54 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost10821.aspx</link><description>Yeah, thanks for the clarification, Keith.&amp;nbsp; Good to know :)</description><pubDate>Mon, 13 Aug 2007 14:44:54 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost10820.aspx</link><description>Old post but I wanted to add that SQL Express does support triggers, if anyone ran across this.</description><pubDate>Mon, 13 Aug 2007 13:40:48 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost9135.aspx</link><description>Thats a good thought, but unfortunatly the application is going to use a MS&amp;nbsp;SQL 2005 Express Edition as a backend, which I don't think supports triggers.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Tue, 29 May 2007 08:12:39 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost9096.aspx</link><description>Hi Robin,&lt;/P&gt;&lt;P&gt;Just a thought - it sounds as though you could fire an update trigger in SQL when the bottom child changes and have the database do the calculation for you.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Fri, 25 May 2007 20:20:07 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost9091.aspx</link><description>I've been running through the Isolation levels, using Chaos results in&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;The IsolationLevel enumeration value, 16, is not supported by the .Net Framework SqlClient Data Provider.&lt;BR&gt;Parameter name: IsolationLevel&lt;/P&gt;&lt;P&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;I thought using ReadUnCommitted would work for me, or at least it would let me fill by PrimaryKey of a record not Committed yet, but it still hangs on ParentBO.FillbyPrimaryKey method.&lt;/P&gt;&lt;P&gt;I guess since the parent child relations are enforced with a cascade delete, dropping the Transaction, and just deleting the Parent most record would also remove the child records untill I can get this figured out.&lt;/P&gt;&lt;P&gt;Thanks Ben.&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Fri, 25 May 2007 12:54:03 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Question about Transactions and ParentRecords...</title><link>http://forum.strataframe.net/FindPost9087.aspx</link><description>Nope, your methodology is good, you just need to change the isolation level.&amp;nbsp; Something like Chaos, or some other isolation level that will allow you to make dirty reads will be what you want.&amp;nbsp; Check the documentation on the different isolation levels.</description><pubDate>Fri, 25 May 2007 12:29:43 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>