Recipe: Azure Postgres with IBM FHIR Server Bulk Data

One of the prerequisites for setting up IBM FHIR Server Bulk Data is setting up max_prepared_transactions since the IBM FHIR Server leverages Open Liberty Java Batch which uses an XA Transaction.

If you are using Azure, here are the steps for updating your Postgres resource.

Navigate to the Azure Portal

Find your Postgres resource

Update your Server Parameters max_prepared_transactions to 200 (anything non-zero is recommended to enable XA)

Click Save

Click Overview

Click Restart

Click On Activity Log

Wait until Postgres is restarted

Restart your IBM FHIR Server, and you are ready to use the Bulk Data feature.

If you don’t do the setup, you’ll see a log like the following:

[9/2/21, 1:49:38:257 UTC] [step1 partition0] com.ibm.fhir.bulkdata.jbatch.listener.StepChunkListener        StepChunkListener: job[bulkexportfastjob/8/15] --- javax.transaction.RollbackException
                                 com.ibm.jbatch.container.exception.TransactionManagementException: javax.transaction.RollbackException
        at com.ibm.jbatch.container.transaction.impl.JTAUserTransactionAdapter.commit(JTAUserTransactionAdapter.java:108)
        at com.ibm.jbatch.container.controller.impl.ChunkStepControllerImpl.invokeChunk(ChunkStepControllerImpl.java:656)
        at com.ibm.jbatch.container.controller.impl.ChunkStepControllerImpl.invokeCoreStep(ChunkStepControllerImpl.java:795)
        at com.ibm.jbatch.container.controller.impl.BaseStepControllerImpl.execute(BaseStepControllerImpl.java:295)
        at com.ibm.jbatch.container.controller.impl.ExecutionTransitioner.doExecutionLoop(ExecutionTransitioner.java:118)
        at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.executeCoreTransitionLoop(WorkUnitThreadControllerImpl.java:96)
        at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.executeWorkUnit(WorkUnitThreadControllerImpl.java:178)
        at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl$AbstractControllerHelper.runExecutionOnThread(WorkUnitThreadControllerImpl.java:503)
        at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.runExecutionOnThread(WorkUnitThreadControllerImpl.java:92)
        at com.ibm.jbatch.container.util.BatchWorkUnit.run(BatchWorkUnit.java:113)
        at com.ibm.ws.context.service.serializable.ContextualRunnable.run(ContextualRunnable.java:79)
        at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:238)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:866)
Caused by: javax.transaction.RollbackException
        at com.ibm.tx.jta.impl.TransactionImpl.stage3CommitProcessing(TransactionImpl.java:978)
        at com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:778)
        at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:711)
        at com.ibm.tx.jta.impl.TranManagerImpl.commit(TranManagerImpl.java:165)
        at com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:113)
        at com.ibm.tx.jta.impl.UserTransactionImpl.commit(UserTransactionImpl.java:162)
        at com.ibm.tx.jta.embeddable.impl.EmbeddableUserTransactionImpl.commit(EmbeddableUserTransactionImpl.java:101)
        at com.ibm.ws.transaction.services.UserTransactionService.commit(UserTransactionService.java:72)
        at com.ibm.jbatch.container.transaction.impl.JTAUserTransactionAdapter.commit(JTAUserTransactionAdapter.java:101)

Go back and enable max_prepared_transactions

References

Azure Docs

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.