Closed Bug 668121 Opened 14 years ago Closed 14 years ago

500 server error when incrementing version on a non-latest testcase

Categories

(Mozilla QA :: Case Conductor-Platform, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: carljm, Assigned: vadimk)

Details

Error follows (same error whether increment is minor or major). Incrementing version on a latest version works fine. ID: 179 Address: /tcm/services/v2/rest/testcases/versions/4/versionincrement/MAJOR Encoding: ISO-8859-1 Content-Type: application/x-www-form-urlencoded Headers: {content-type=[application/x-www-form-urlencoded], Authorization=[Basic YWRtaW5AdXRlc3QuY29tOmFkbWlu], host=[localhost:8080], Content-Length=[265], user-agent=[TCMui/0.3], accept-encoding=[identity], Content-Type=[application/x-www-form-urlencoded], Accept=[application/json]} Payload: majorVersion=0&minorVersion=1&name=Can+edit+others%27+test+cases+as+admin&companyId=1&originalVersionId=3&testCaseId=6&automationUri=&automated=False&maxAttachmentSizeInMbytes=0&latestVersion=False&productId=1&maxNumberOfAttachments=0&description=A+new+description. -------------------------------------- 23:29:01,351 INFO [PhaseInterceptorChain] Application {http://v2.impl.webservice.utest.com/}CompanyWebServiceImpl has thrown exception, unwinding now: org.hibernate.NonUniqueResultException: query did not return a unique result: 2 23:29:01,351 INFO [LoggingInInterceptor] Outbound Message --------------------------- ID: 179 Response-Code: 500 Encoding: ISO-8859-1 Content-Type: application/json Headers: {} Payload: {"errors":[{"error":"query did not return a unique result: 2"}]}
I actually had a TODO comment in the code to address that since a long time ago...Fixed now...
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Now getting a "Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect" error anytime I try to version-increment a non-latest TestCaseVersion. Platform log below shows that correct originalVersionId is being sent with versionincrement API call. Still works with latest TestCaseVersion. ID: 12 Response-Code: 200 Content-Type: application/json Headers: {Date=[Mon, 04 Jul 2011 23:04:39 GMT]} Payload: {"ns1.testcaseversion":[{"@xsi.type":"ns1:testcaseversion","ns1.resourceIdentity":{"@id":"4","@url":"http:\/\/localhost:8080\/tcm\/services\/v2\/rest\/testcases\/versions\/4","@version":"3","@xsi.type":"ns1:ResourceIdentity"},"ns1.timeline":{"@createDate":"2011-06-28T19:25:47Z","@createdBy":"3","@lastChangeDate":"2011-06-28T23:21:10Z","@lastChangedBy":"1","@xsi.type":"ns1:Timeline"},"ns1.approvalStatusId":2,"ns1.approveDate":"2011-06-28T23:21:06Z","ns1.approvedBy":1,"ns1.approvedByLocator":{"@id":"1","@url":"http:\/\/localhost:8080\/tcm\/services\/v2\/rest\/users\/1","@xsi.type":"ns1:ResourceLocator"},"ns1.automated":false,"ns1.automationUri":"","ns1.companyId":1,"ns1.companyLocator":{"@id":"1","@url":"http:\/\/localhost:8080\/tcm\/services\/v2\/rest\/companies\/1","@xsi.type":"ns1:ResourceLocator"},"ns1.description":"","ns1.latestVersion":false,"ns1.majorVersion":0,"ns1.maxAttachmentSizeInMbytes":0,"ns1.maxNumberOfAttachments":0,"ns1.minorVersion":1,"ns1.name":"Can edit others' test cases as admin","ns1.productId":1,"ns1.productLocator":{"@id":"1","@url":"http:\/\/localhost:8080\/tcm\/services\/v2\/rest\/products\/1","@xsi.type":"ns1:ResourceLocator"},"ns1.testCaseId":6,"ns1.testCaseStatusId":2,"ns1.testCycleId":{"@xsi.nil":"true"},"ns1.testCycleLocator":{"@xsi.nil":"true"}}]} -------------------------------------- 23:04:44,616 INFO [LoggingInInterceptor] Inbound Message ---------------------------- ID: 13 Address: /tcm/services/v2/rest/testcases/versions/4/versionincrement/MINOR Encoding: ISO-8859-1 Content-Type: application/x-www-form-urlencoded Headers: {content-type=[application/x-www-form-urlencoded], Authorization=[Basic YWRtaW5AdXRlc3QuY29tOmFkbWlu], host=[localhost:8080], Content-Length=[247], user-agent=[TCMui/0.3], accept-encoding=[identity], Content-Type=[application/x-www-form-urlencoded], Accept=[application/json]} Payload: majorVersion=0&minorVersion=1&name=Can+edit+others%27+test+cases+as+admin&companyId=1&originalVersionId=3&testCaseId=6&automationUri=&automated=False&maxAttachmentSizeInMbytes=0&latestVersion=False&productId=1&maxNumberOfAttachments=0&description= -------------------------------------- 23:04:44,660 INFO [PhaseInterceptorChain] Application {http://v2.impl.webservice.utest.com/}CompanyWebServiceImpl has thrown exception, unwinding now: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.utest.domain.TestCaseVersion#17] 23:04:44,661 INFO [LoggingInInterceptor] Outbound Message --------------------------- ID: 13 Response-Code: 409 Encoding: ISO-8859-1 Content-Type: application/json Headers: {} Payload: {"errors":[{"error":"Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.utest.domain.TestCaseVersion#17]"}]} --------------------------------------
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: nobody → vadimk
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.