I'm writing java library(jar file) to log Web service request and responses in a Database for in-house application. This library will have two methods
I'm wondering is it good idea to pass database connection to these library methods?
Passing connection to library will have some pros and cons.
Pros: One connection can be used to register request and response, both of them. This decrease delay of opening second connection. In some cases, caller service will use the same connection too.
Cons: Caller service and library becomes coupled.