Issue after JPA Server Upgrade

688 views
Skip to first unread message

Andrea Caloni

unread,
Jun 9, 2023, 8:54:28 AM6/9/23
to HAPI FHIR
Hello,
I have experienced an issue while updating an instance of a JPA server, version 6.1.0, to the latest 6.6.0.
I followed the instructions for executing a database migration (https://hapifhir.io/hapi-fhir/docs/server_jpa/upgrading.html), and the operation completed successfully.
When I run the JPA server ver 6.6.0, it starts correctly, but it raises every minute the following exception:

2023-06-09 14:19:09.617 [hapi-fhir-jpa-scheduler-clustered-1] INFO  c.uhn.fhir.log.batch_troubleshooting [JobMaintenanceServiceImpl.java:203] Maintenance pass starting.
2023-06-09 14:19:09.631 [hapi-fhir-jpa-scheduler-clustered-1] INFO  o.h.e.j.b.internal.AbstractBatchImpl [AbstractBatchImpl.java:213] HHH000010: On release of batch it still contained JDBC statements
2023-06-09 14:19:09.631 [hapi-fhir-jpa-scheduler-clustered-1] ERROR o.h.e.j.batch.internal.BatchingBatch [BatchingBatch.java:139] HHH000315: Exception executing batch [org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update bt2_job_instance set job_cancelled=?, cmb_recs_processed=?, cmb_recs_per_sec=?, create_time=?, cur_gated_step_id=?, definition_id=?, definition_ver=?, end_time=?, error_count=?, error_msg=?, est_remaining=?, fast_tracking=?, params_json=?, params_json_lob=?, progress_pct=?, report=?, start_time=?, stat=?, tot_elapsed_millis=?, update_time=?, work_chunks_purged=? where id=? and update_time=?], SQL: update bt2_job_instance set job_cancelled=?, cmb_recs_processed=?, cmb_recs_per_sec=?, create_time=?, cur_gated_step_id=?, definition_id=?, definition_ver=?, end_time=?, error_count=?, error_msg=?, est_remaining=?, fast_tracking=?, params_json=?, params_json_lob=?, progress_pct=?, report=?, start_time=?, stat=?, tot_elapsed_millis=?, update_time=?, work_chunks_purged=? where id=? and update_time=?
2023-06-09 14:19:09.633 [hapi-fhir-jpa-scheduler-clustered-1] ERROR c.uhn.fhir.log.batch_troubleshooting [JobMaintenanceServiceImpl.java:206] Maintenance pass failed
ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException: HAPI-0826: The operation has failed with a version constraint failure. This generally means that two clients/threads were trying to update the same resource at the same time, and this request was chosen as the failing request.
at ca.uhn.fhir.jpa.config.HapiFhirHibernateJpaDialect.convertHibernateAccessException(HapiFhirHibernateJpaDialect.java:113)
at ca.uhn.fhir.jpa.config.HapiFhirHibernateJpaDialect.convertHibernateAccessException(HapiFhirHibernateJpaDialect.java:64)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:566)
...

Please note that the server works correctly, and it is able to fulfill the client requests.
The previous version of the JPA Server (6.1.0) didn't raise any exception about any scheduler.
The underlying database is Postgres 14.
Do you have any suggestions about the issue with this scheduler ?

Thanks

Andrea
Message has been deleted

Judith

unread,
Dec 11, 2023, 10:40:12 AM12/11/23
to HAPI FHIR
I experience the same problem. It looks like (at least in my case), that a default value for field "UPDATE_TIME" in table "bt2_job_instance" is needed. 
Did you find a way how to solve it?

20.sande...@gmail.com schrieb am Dienstag, 22. August 2023 um 06:50:45 UTC+2:
Have you got any solution to your problem.. I am also facing the same problem while using profile in FHIR server.

Andrea Caloni

unread,
Dec 13, 2023, 3:59:07 AM12/13/23
to HAPI FHIR
Hi, I wasn't able to solve the problem with 6.6.0 release.
But using the latest 6.10.0 the problem is no more present.

Reply all
Reply to author
Forward
0 new messages