﻿<?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 » WinForms (How do I?)  » Transactions on Forms</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 09:34:42 GMT</lastBuildDate><ttl>20</ttl><item><title>Transactions on Forms</title><link>http://forum.strataframe.net/FindPost20383.aspx</link><description>I have a requirement to use transactions on one of my entry forms. Note: I am not using the MaintnenaceFormToolStrip. I have three business objects on a form and some of the fields are bound to controls etc... Pretty standard form.&lt;/P&gt;&lt;P&gt;Do I simply start the transaction in the FORM 'BeforeSave' event on the Form and then commit the transaction in the FORM 'AfterSave' event? &lt;/P&gt;&lt;P&gt;Any assistance would be appeciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim</description><pubDate>Mon, 03 Nov 2008 12:53:40 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Transactions on Forms</title><link>http://forum.strataframe.net/FindPost20521.aspx</link><description>Just wondering if I'm headed in the right direction dealing with Transactions within forms. Any input would be appreciated.</description><pubDate>Mon, 03 Nov 2008 12:53:40 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Transactions on Forms</title><link>http://forum.strataframe.net/FindPost20441.aspx</link><description>Thanks for the help guys, I was able to get things working&amp;nbsp;except for&amp;nbsp;handling of&amp;nbsp;broken rules. Using the example, what if there were broken rules on the orders table - Me.Orders.Save(True) after the transaction was started.&amp;nbsp; Would you first check all for broken rules on all business objects before calling 'SaveAllOnTransaction' or check the status of each save within the transactions and perform a rollback if a broken rule is found?&amp;nbsp;&amp;nbsp;At first I thought it would be pretty simple to implement transactions at the form level but I lost some of the power of StataFrame with form level events etc...&lt;/P&gt;&lt;P&gt;Let me know if I'm missing the ball on this or if you have any suggestions on how to handle broken rules etc.. when using transactions.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tim</description><pubDate>Thu, 30 Oct 2008 09:47:11 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Transactions on Forms</title><link>http://forum.strataframe.net/FindPost20396.aspx</link><description>There is a nice sample in the help file with the topic &lt;STRONG&gt;"&lt;SPAN id=pagetitle&gt;Using Transactional Processing"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;SPAN&gt;[codesnippet][code]Public Sub SaveAllOnTransaction()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Add a try around the transaction processing&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; This enables the process to call TransactionRollback()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; if anything bad happens during the transaction process.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Start the transaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessLayer.TransactionBegin("", Data.IsolationLevel.ReadCommitted)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Save the business objects on the transaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Customers.Save(True)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Orders.Save(True)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.OrderItems.Save(True)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- When business objects are saved on the transaction, the&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; pending changes to their internal DataTables are NOT saved&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; until TransactionEnd() is called...&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Call transaction end to commit the transaction queries and&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; accept the pending changes on all of the business objects&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; that participated in the transaction.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessLayer.TransactionCommitt("")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- If an exception occurs during the saving of the records, then &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; abort the transaction.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessLayer.TransactionRollback("")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;BR&gt;End Sub&lt;BR&gt;[/code][/codesnippet]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;</description><pubDate>Tue, 28 Oct 2008 12:45:30 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transactions on Forms</title><link>http://forum.strataframe.net/FindPost20389.aspx</link><description>You can, or you could create a method that is called versus calling the Save directly on the form first.&amp;nbsp; For example, you would create a method that starts the transactions, calls the Save() or the BOs directly, and the commit the transactions after the save.</description><pubDate>Tue, 28 Oct 2008 10:16:31 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>