Database concurrency condition detected on testset update via SOAP api

Friday, February 10, 2012 3:16:13 PM
We use SpiraTeam 3.1 at the moment and are experimenting with the SOAP API.

All goes fine, but 1 thing came up:
when performing a TestSet_Update to update the status (from eg not started to "in progress") all is ok.
when doing the same action again to set the status to yet another value we get:
Server raised fault: 'Database concurrency condition detected'

and very consistent. First time no problem, second time always the same error.

Is this a known issue or is there a workaround?

thx,
Filip
3 Replies
Friday, February 10, 2012 3:59:09 PM
Avatar
re: FilipBaert on Friday, February 10, 2012 3:16:13 PM
This is by design, you need to do a TestSet_RetrieveById first to get the refreshed data then call the TestSet_Update method. This ensures that you don't have outdated data.
Monday, February 13, 2012 12:36:10 PM
Avatar
re: inflectra.adam on Friday, February 10, 2012
ok, sounds reasonable, but unfortunately the RetrieveById does not solve the error.

this is the complete message from spirateam:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">Database concurrency condition detected</faultstring><detail><ServiceFaultMessage xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v3_0" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message>Database concurrency condition detected</Message><StackTrace>   at Inflectra.SpiraTest.Business.TestSet.Update(TestSetData testSetDataSet, Int32 userId, Nullable`1 intRollbackId)&#xD;
   at Inflectra.SpiraTest.Web.Services.v3_0.ImportExport.TestSet_Update(RemoteTestSet remoteTestSet)</StackTrace><Type>DataAccessConcurrencyException</Type></ServiceFaultMessage></detail></s:Fault></s:Body></s:Envelope>


this is our python code:
  testSetToExecute = getTestSetToExecute(automationHostName)  =>> function gives 1 testset that meets specific filters.
  if(testSetToExecute is not None):
    testCasesToExecute = client.service.TestCase_RetrieveByTestSetId(testSetToExecute.TestSetId)
    testSetToExecute =client.service.TestSet_RetrieveById(testSetToExecute.TestSetId)
    testSetToExecute.TestSetStatusId = 2 #in progress
    testSetToExecute.TestSetStatusName = "In Progress"
    testSetToExecute.ExecutionDate = datetime.now()
    client.service.TestSet_Update(testSetToExecute)

the last line fails with given error.

thx for the help
Filip

Monday, February 27, 2012 8:37:40 PM
Avatar
re: FilipBaert on Monday, February 13, 2012
Could it be that the LastUpdateDate is not being sent back correctly? That is what's used to verify that the data is current? Also do you have the latest patch for v3.1 applied?
Statistics
  • Started: Friday, February 10, 2012 3:16:13 PM
  • Last Reply: Monday, February 27, 2012 8:37:40 PM
  • Replies: 3
  • Views: 896