Data conflict checking inaccurate, and infinite update


Author
Message
Chan
Chan
Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
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?
Chan
Chan
Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
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
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
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.

Chan
Chan
Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

The SQL is dynamically generated by SF datalayer.



I don have any field to keep row version.



Any ideas?
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
What field does the business object think is modified?  Can you send a screen shot of the data collision form?
Chan
Chan
Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

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

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search