﻿<?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?)  » Data collision problem/question</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:28:02 GMT</lastBuildDate><ttl>20</ttl><item><title>Data collision problem/question</title><link>http://forum.strataframe.net/FindPost1056.aspx</link><description>I have a table that contains 2 columns, updated_on and updated_by, that are updated by an update trigger in the database (SQLServer 2005).&amp;nbsp; The BO's fill method uses a simple "SELECT * FROM TABLE" statement.&amp;nbsp; Whenever I update a particular row more than once using the same instance of the BO, I get a data collision on the updated_on column.&amp;nbsp; Since the user doesn't directly update the updated_on/by columns I changed the SELECT&amp;nbsp;statement&amp;nbsp;in the BO not to return them.&amp;nbsp; The data collision problem has now&amp;nbsp;gone away.&lt;/P&gt;&lt;P&gt;Should I keep columns updated by triggers out of updateable BOs?</description><pubDate>Tue, 02 May 2006 14:04:20 GMT</pubDate><dc:creator>franka</dc:creator></item><item><title>RE: Data collision problem/question</title><link>http://forum.strataframe.net/FindPost1058.aspx</link><description>Well, you could accomplish this in on of a couple ways:&lt;br&gt;
&lt;br&gt;
1)  Let the business object handle the updatedby and updatedon columns.  You can add the FieldPropertyChanged event to the business object(s) through the BOMapper, and set the updated properties in that event.  When you change one of the properties, the business object updates its field.&lt;br&gt;
&lt;br&gt;
2)  Add a column for row versioning.  Basically, by default, the business object will check all of the columns against the columns in the database to see if the row has been updated (causing a concurrency exception).  When the trigger updates the row, the business object thinks that another user updated it because it doesn't know the difference.  You can change the UpdateConcurrencyType property on the business object(s) to RowVersion and use an INT column to hold the row version.  When the BO saves, it will update the row version, and when the trigger updates the table, it won't update the row version column, so the business object won't know someone else is modifying the record.  &lt;br&gt;
&lt;br&gt;
Row versioning is also more efficient than the default concurrency verification type because you're only testing one value rather than 3 tests for each column (but row versioning requires you to change your data structure, so we couldn't make it the default).</description><pubDate>Tue, 02 May 2006 14:04:20 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>