StrataFrame Forum

Problem Using CLR for CRUD Stored Procedures

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

By Larry McIntosh - 1/1/2012

I normally use stored procedures for Insert/Update/Delete in Business Objects using standard SF naming convention and syntax with a TimeStamp column for RowVersion control.  However, creating the equivalent SPs as CLR SPs does not work for Updates.  Insert and Delete work fine but not Updates.  I am passing the current RowVersion value and the update is successful in the database including returning the new RowVersion value but the SF Save routine complains that the TimeStamp values indicate someone else has altered the record.  I even have the problem if I call the CLR SP from a T-SQL SP.  I suspect it has something to do with SET NOCOUNT effects since CLR SPs hide this and SF requires NOCOUNT is OFF for CRUD SPs.  I can get it to work by updating ANY table in the SQL database before retrieving the new RowVersion value but I don't understand why.

It's may not even be a good idea to use CLR CRUD SPs instead of T-SQL but I'd like to resolve the issue in order to understand the SF framework better.