Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when submitting a bulk edit #393

Open
jamesrwelch opened this issue Feb 14, 2023 · 1 comment
Open

Exception when submitting a bulk edit #393

jamesrwelch opened this issue Feb 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jamesrwelch
Copy link
Contributor

When editing a large model (I think), using the bulk editor to update descriptions, I get the following exception:

{
  "headers": {
    "normalizedNames": {},
    "lazyUpdate": null
  },
  "status": 500,
  "statusText": "OK",
  "url": "https://cdw.oxnet.nhs.uk/mauro-data-mapper/api/dataModels/5393fb54-5732-4ff2-a044-3af8b0692630/dataClasses/4d7ce8b0-3ab8-418e-8d60-56197a6c9bce/dataElements/aa2375ff-8cad-4eea-b678-6e660df45850",
  "ok": false,
  "name": "HttpErrorResponse",
  "message": "Http failure response for https://cdw.oxnet.nhs.uk/mauro-data-mapper/api/dataModels/5393fb54-5732-4ff2-a044-3af8b0692630/dataClasses/4d7ce8b0-3ab8-418e-8d60-56197a6c9bce/dataElements/aa2375ff-8cad-4eea-b678-6e660df45850: 500 OK",
  "error": {
    "status": 500,
    "reason": "Internal Server Error",
    "errorCode": "UEX--",
    "message": "Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update datamodel.data_class set version=?, date_created=?, last_updated=?, path=?, min_multiplicity=?, max_multiplicity=?, parent_data_class_id=?, breadcrumb_tree_id=?, data_model_id=?, idx=?, created_by=?, aliases_string=?, label=?, description=? where id=? and version=?",
    "path": "/api/dataModels/5393fb54-5732-4ff2-a044-3af8b0692630/dataClasses/4d7ce8b0-3ab8-418e-8d60-56197a6c9bce/dataElements/aa2375ff-8cad-4eea-b678-6e660df45850",
    "version": "5.3.0-SNAPSHOT",
    "exception": {
      "type": "StaleStateException",
      "message": "Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update datamodel.data_class set version=?, date_created=?, last_updated=?, path=?, min_multiplicity=?, max_multiplicity=?, parent_data_class_id=?, breadcrumb_tree_id=?, data_model_id=?, idx=?, created_by=?, aliases_string=?, label=?, description=? where id=? and version=?",
      "stacktrace": [
        "org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:67)",
        "org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:54)",
        "org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts(BatchingBatch.java:155)",
        "org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:130)",
        "org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:110)",
        "org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:153)",
        "org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch(JdbcCoordinatorImpl.java:187)",
        "org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3513)",
        "org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3438)",
        "org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3852)",
        "org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:201)",
        "org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)",
        "org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)",
        "org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)",
        "org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:344)",
        "org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40)",
        "org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)",
        "org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1407)",
        "org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1394)",
        "uk.ac.ox.softeng.maurodatamapper.core.model.CatalogueItemService.save(CatalogueItemService.groovy:100)",
        "uk.ac.ox.softeng.maurodatamapper.datamodel.item.DataElementService.$tt__dataElementService_save(DataElementService.groovy:148)",
        "grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)",
        "org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)",
        "grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)",
        "uk.ac.ox.softeng.maurodatamapper.datamodel.item.DataElementController.serviceInsertResource(DataElementController.groovy:173)",
        "uk.ac.ox.softeng.maurodatamapper.core.controller.CatalogueItemController.serviceUpdateResource(CatalogueItemController.groovy:41)",
        "uk.ac.ox.softeng.maurodatamapper.core.controller.CatalogueItemController.updateResource(CatalogueItemController.groovy:56)",
        "uk.ac.ox.softeng.maurodatamapper.datamodel.item.DataElementController.updateResource(DataElementController.groovy:195)",
        "uk.ac.ox.softeng.maurodatamapper.core.controller.EditLoggingController.$tt__editLoggingController_update(EditLoggingController.groovy:108)",
        "grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)",
        "org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)",
        "grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)",
        "org.grails.core.DefaultGrailsControllerClass$MethodHandleInvoker.invoke(DefaultGrailsControllerClass.java:223)",
        "org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188)",
        "org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)",
        "org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)",
        "org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)",
        "org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)",
        "org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:920)",
        "org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)",
        "org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)",
        "org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)",
        "org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:126)",
        "org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:64)",
        "org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:101)",
        "org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:119)"
      ]
    }
  }
}
@jamesrwelch jamesrwelch added the bug Something isn't working label Feb 14, 2023
@jamesrwelch
Copy link
Contributor Author

(This works on my local instance, so may have been fixed since the CDW instance was last deployed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant