fhir-data-pipes icon indicating copy to clipboard operation
fhir-data-pipes copied to clipboard

Switch the batch JDBC mode to use HikariCP instead of C3P0

Open kimaina opened this issue 4 years ago • 3 comments
trafficstars

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

kimaina avatar Jan 06 '21 15:01 kimaina

To be clear, we currently use C3P0 and want to switch to HikariCP, not the other way around, right?

bashir2 avatar Jan 06 '21 22:01 bashir2

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

kimaina avatar Jan 07 '21 07:01 kimaina

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.

bashir2 avatar May 04 '23 15:05 bashir2