Hey Steve, Thanks for the response. Given my situation, the amount of third party software I can use is limited or would need approval. So I am hesitant to go down that road.
Do you now whether or not database connections can be assigned at any point other than during startup when the run() method is called? On Thursday, February 1, 2018 at 2:06:10 PM UTC-6, Steve Kradel wrote: > > Generally, the best bet is to adopt a pooling/validating datasource like > HikariCP. Not familiar with FCF but it sounds like a vendor-specific > feature that might be supported by the JDBC driver. > > Managed objects are for startup and cleanup tied to the lifecycle of the > Dropwizard application, not a great fit for a connection pool that can heal > itself without a restart. > > On Thursday, February 1, 2018 at 2:09:15 PM UTC-5, Alexander Page wrote: >> >> Hey, >> >> *GOAL:* I am trying to allow my microservice to be able to establish a >> new datasource if the current datasource becomes invalid (in the case the >> db fails). >> >> *Option 1:* >> The database that my dropwizard microservice is connected supports >> Fast-Connection-Failover (FCF). Currently, I am supporting FCF using JDBC >> in my main app. From what I have read, I do not believe that JDBI has that >> functionality to interface with Oracle Notification Service. Does anyone >> know if it is possible through JDBI? And can point me to some resources. >> >> *Option 2:* >> My other option was to auto reconnect to the datasource upon failure. To >> do this, I thought I would re-establish a datasource connection dynamically >> assuming the datasource has the same configuration as the original. >> >> For example, I was thinking of prior to calling my SQL Query to run a >> validateDatasource() type method that would run a validation query against >> the current datasource connection. If it was successful then all is fine >> and dandy, if not, I would try to build a new DBI until successful. >> >> But I am not sure if it is possible to reassign the datasource outside of >> the dropwizard-app's run() method. >> >> *Option 3:* >> I read the documentation about Managed Objects ( >> http://www.dropwizard.io/1.2.2/docs/manual/core.html#managed-objects) I >> was wondering if it would make sense to have my datasource as a manage >> object that I could have a restart method attached to and run that at any >> point. >> >> >> Any help or information that'll point me in the right direction is much >> appreciated, >> >> Alexander >> > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.