Optimistic Conncurrency Issue


Author
Message
Clayton Hoyt
Clayton Hoyt
StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)
Group: Forum Members
Posts: 40, Visits: 85
I have a BO setup to use OptimisticAllFields on Update. I use stored procedures generated by the DDT but when I run an update I get the below error:

"MicroFour.StrataFrame.Data.DataLayerSavingException: Procedure or Function 'ha_rfp_update' expects parameter '@PROSPECT_NAME_ORG', which was not supplied. ---> System.Data.SqlClient.SqlException: Procedure or Function 'ha_rfp_update' expects parameter '@PROSPECT_NAME_ORG', which was not supplied.

 -- Yada yada ----

at MicroFour.StrataFrame.Business.BusinessLayer.Save(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Business.BusinessLayer.Save()

at RFPEdit.SaveRFP() in D:\TMG\HA\RFP\WEB\RFPEdit.aspx.vb:line 120"

What am I doing wrong here?

Thanks

Clay


Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
What do your CRUD settings look like on the BO?  It sounds like your CRUD settings are not setup to match the stored procedure.
Clayton Hoyt
Clayton Hoyt
StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)
Group: Forum Members
Posts: 40, Visits: 85
Unfortunatly, they look good...just like all the others I have that do work. The Insert works fine...I've not tried the Delete but I'd imagine it would work also. All of the sprocs were created using the DDT and I've verified that they are spelled right (I'd think if it were misspelled I'd be getting other errors anyway). I recreated them to make sure something hadn't changed. I tried rebuilding...screaming...rebooting...w00t


Clayton Hoyt
Clayton Hoyt
StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)
Group: Forum Members
Posts: 40, Visits: 85
Here is piece of the code that won't work

If intRFPID = 0 Then

.NewRow()

Else

.FillRFPByID(intRFPID)

.Edit()

End If

.PROSPECT_NAME = Me.txtProspect.Text

.COMMENTS = Me.txtComments.Text

If .Save() <> MicroFour.StrataFrame.Data.SaveUndoResult.Success Then Me.lblResult.Text = "The record was NOT saved."


Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Well, just to remove any confusion let me give you a quick overview so that you can make sure all of the BO properties are set properly.

Database Deployment Toolkit
Here is a table where I am allowing the DDT to create my stored procedures.

In this example, my table name is TestNames and you can see the default names that are generated.  You can rename the stored procs, but if you do you will need to specify the procs names on the BO explicitly.

BO CRUD Settings
Here are the CRUD settings that are set within the property sheet of my business object.

In this scenario, this is all that needs to be done in order to properly update your table using a sproc.  Notice that I did not specify the InsertStoredProcedureName or UpdateStoredProcedureName.  The reason I could do this is because of the default naming schema expected when using the DDT.  If the sprocs do not match the schema: TableName_Insert, TableName_Udpate, and tableName_Delete....then you will need to set the StoredProcedureName properties.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
One other thing to look at...open the stored procedure through the SQL Server Management Studio (or Enterprise Manager) and let me look at it here.  Also, I will need the table structure so I have something to compare it to.
Clayton Hoyt
Clayton Hoyt
StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)
Group: Forum Members
Posts: 40, Visits: 85
Hi Trent

Here are my DDT settings


Clayton Hoyt
Clayton Hoyt
StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)
Group: Forum Members
Posts: 40, Visits: 85
Trent...I sent the sproc to your email.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Clayton...can you try something for me.  Before I try to dig out all of the stored procs settings, can you add a row version field to you table and attemt to use Row versioning.  The WHERE clause of your stored proc will basically go to nothing...but I just want to see if this resolves your problem.

Just add an integer field in your table.  Open the table properties and indicate that you are going to use row versioning and provide the version field. (obviously deploy your structure).

Go to the CRUD settings on your BO and change the following properties:

UpdateConcurrencyType = OptimisticRowVersion
RowVersionOrTimestampColumn = "YourRowVersionFieldName"

Rebuild and try this again and see if the error persists.

Clayton Hoyt
Clayton Hoyt
StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)StrataFrame Novice (66 reputation)
Group: Forum Members
Posts: 40, Visits: 85
Hi Trent

I created a field name ROWVER as an INT and changed the options to use RowVersioning. Now it tells me that the sproc needs @ROWVER but its not provided.

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