Re: [JDBC] Should we still put the driver in CATALINA_HOME/lib andnot in the application's war?

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: [JDBC] Should we still put the driver in CATALINA_HOME/lib andnot in the application's war?
Дата
Msg-id CADK3HHLh+rp-axs8bzKB5WF6Z29WiUz9ovk9NNa45Cm+ji2=Hg@mail.gmail.com
обсуждение исходный текст
Ответ на [JDBC] Should we still put the driver in CATALINA_HOME/lib and not in theapplication's war?  (Miguel Almeida <migueldealmeida@gmail.com>)
Список pgsql-jdbc
So if you put them in tomcat's lib dir then yes it will be registered in the JVM wide singleton. I would think this should not be a problem if you put them the apps war file. All drivers register in DriverManager which should be unique per app.


On 14 August 2017 at 13:33, Miguel Almeida <migueldealmeida@gmail.com> wrote:
Dear all,

I recently revisited the decision in my projects to put both the postgresql and c3p0 driver in Tomcat's lib directory instead of putting it in each application's package (see the stackoverflow post below [1], still unresolved!).

In 2011 Philip Reichart mentioned that JDBC drivers register themselves in the JVM-wide singleton DriverManager which is shared by all web apps. If you have the same (as in class name) JDBC driver register twice from two different web apps, this might cause your problem. This is even more problematic if your web apps use different versions of the same JDBC driver.

Is this still the case in 2017?

The reason why this may become problematic is that my team is having difficulties upgrading the postgresql driver from version x to y, which may lead to the need to have different postgresql driver versions for different applications within the same tomcat container.
Can you kindly help me underestand the consequences of that?


[1] https://stackoverflow.com/questions/45621073/where-to-put-c3p0-dependency-in-tomcat-container

[2] https://stackoverflow.com/a/7198049/475829

Thank you very much for your input!

Miguel Almeida

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Miguel Almeida
Дата:
Сообщение: [JDBC] Should we still put the driver in CATALINA_HOME/lib and not in theapplication's war?
Следующее
От: Piyush Sharma
Дата:
Сообщение: [JDBC] [pgjdbc/pgjdbc] 29f574: doc: Added quotes to URL in '@see' tag overorg.po...