StrataFrame Forum

Data conflict checking inaccurate, and infinite update

http://forum.strataframe.net/Topic10612.aspx

By Chan - 7/28/2007

Hi,

I faced problem that, SF data collision checking incorrect. Even though that is no data conflict, but SF still show conflict dialog. I select myValue and click save. It caused inifinite loop. I checked Profiler, it keep executing update statement nonstop.



Any ideas?
By Chan - 7/29/2007

Hi,

After some debugging, I found that, when update my table, the RecordsAffected property value in the following code return 0 which affected by my update trigger.



'-- We need to execute the first command reader because it's a batch

loReader = Me.InternalExecuteReader(loCommand, QueryInfo.IsTransactional, QueryInfo.TransactionKey)



'-- Get the rows affected

lnReturn = loReader.RecordsAffected





I have SET NOCOUNT ON in my trigger, but still not work. Any ideas?



Thank you
By StrataFrame Team - 7/30/2007

Is the UPDATE statement being built by the data source dynamically, or is it executing a stored procedure?  If it's executing a stored procedure, then make sure that SET NOCOUNT ON is not turned on in the sproc (you might have to explicitly call SET NOCOUNT OFF), since it's the one that is returning the number of records affected. 

Also, if you have a trigger that is updating the value, and you're using a TIMESTAMP field for concurrency, then each time the trigger modifies the row, the timestamp is also going to change, meaning that the value within the BO is not going to match, so you're going to get a concurrency exception when you update the row again (since the trigger just modified it).  If this is the case, consider moving to row versioning; change the timestamp column to an integer column, and tell the business object to use row versioning.

By Chan - 7/30/2007

Hi,

The SQL is dynamically generated by SF datalayer.



I don have any field to keep row version.



Any ideas?
By StrataFrame Team - 7/30/2007

What field does the business object think is modified?  Can you send a screen shot of the data collision form?
By Chan - 7/30/2007

Hi,

You could find the screenshot from attachment in post#1 in this thread