﻿<?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?)  » Transaction between Business Objects</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 18 Sep 2026 22:01:25 GMT</lastBuildDate><ttl>20</ttl><item><title>Transaction between Business Objects</title><link>http://forum.strataframe.net/FindPost23934.aspx</link><description>Hello! Say that you have two tables and for each table you have a Business Object. What If I want to put both tables in a transaction? Is there a way to control this (Transaction between these 2 BO's), or should I control transactions on stored procedures in one custom method&amp;nbsp;in one of the BO's?&lt;/P&gt;&lt;P&gt;Thank you!</description><pubDate>Wed, 29 Jul 2009 11:20:48 GMT</pubDate><dc:creator>Milton Abe</dc:creator></item><item><title>RE: Transaction between Business Objects</title><link>http://forum.strataframe.net/FindPost23961.aspx</link><description>The only time that I ever recommend wrapping up transactions in the DB is when all INSERT logic, etc. will be server side, otherwise doing the transaction on the DB is more work and requires more code client side if this isn't the case.  So yes, I would recommend doing this within the BO since this logic is tied into the BO.</description><pubDate>Wed, 29 Jul 2009 11:20:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Transaction between Business Objects</title><link>http://forum.strataframe.net/FindPost23959.aspx</link><description>In other words you still think that SF might has a better approach than transactions in DB? Or is there any particular case that you would recommend transactions in DB?</description><pubDate>Wed, 29 Jul 2009 11:05:16 GMT</pubDate><dc:creator>Milton Abe</dc:creator></item><item><title>RE: Transaction between Business Objects</title><link>http://forum.strataframe.net/FindPost23943.aspx</link><description>Peter has a good approach, but really SF gives you more ultimate control on saving.  So you will, in this particular case, want to create a transaction with a key and then use the same key for both saves.  When you call the Save method of a BO, you can provide the transaction key, which means that you can choose which BOs to save on a tran and which to save off of a tran.  So in this example, you would call the Save method on the BOs and supply the same transaction for both:&lt;br&gt;
&lt;br&gt;
[codesnippet]BusinessLayer.TransactionBegin("MyTranKey", Data.IsolationLevel.ReadCommitted);&lt;br&gt;
&lt;br&gt;
MyBO1.Save(True, "MyTranKey");&lt;br&gt;
MyBO2.Save(True, "MyTranKey");&lt;br&gt;
&lt;br&gt;
BusinessLayer.TransactionCommit("MyTranKey");[/codesnippet]</description><pubDate>Wed, 29 Jul 2009 09:30:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Transaction between Business Objects</title><link>http://forum.strataframe.net/FindPost23935.aspx</link><description>Hi Milton,&lt;br&gt;
&lt;br&gt;
My view is that if a transaction can be done in the database then that is best place it. I'm a great fan of SF but, when it comes to something like a transaction, I just think the database is the safer and more efficient alternative. Although, I have to say, this view has meant that I have never looked at the transaction facilities in SF in any detail.&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Tue, 28 Jul 2009 19:05:39 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item></channel></rss>