fhir-data-pipes
fhir-data-pipes copied to clipboard
Switch the batch JDBC mode to use HikariCP instead of C3P0
Lastly, I also tried using Hikari instead of c3po, however, I have been having compatibility issues. So APache beam PTransform/DoFn expects the datasource to be serializable. I tried injecting Hikari using @setup() without success as advised here. Also tried using .withDataSourceProviderFn((SerializableFunction<Void, DataSource>). Most recommendation keeps on pointing back to c3po. Please let me know if you know a walk around for this issue. A
Originally posted by @kimaina in https://github.com/GoogleCloudPlatform/openmrs-fhir-analytics/issues/72#issuecomment-747310796
To be clear, we currently use C3P0 and want to switch to HikariCP, not the other way around, right?
To be clear, we currently use C3P0 and want to switch to HikariCP, not the other way around, right?
Yes! Thanks @bashir2 for the correction
Just to add a little more context re. why this is not a very high priority performance issue: Currently, the way JdbcIO.ReadFn is implemented is by constructing (deserializing) the DataSource once per worker here. Then one single connection is used to process each bundle, i.e., a connection is returned to the pool in @FinishBundle here. So the rate of acquiring connections is not that high and hence switching the connection pool manager should not have a huge impact on the overall performance.