Configure JDBC driver in JBoss 7 - as a deployment OR as a module?

牧云@^-^@ 提交于 2019-12-05 04:09:27

问题


As mentioned in the article https://community.jboss.org/wiki/DataSourceConfigurationInAS7 JBoss 7 provides 2 main ways to configure a data source.

What is the BEST practice of configuring a data source in JBoss 7 AS ? Is it

  1. As a module?
  2. As a deployment?

(The same question has been asked in the thread https://community.jboss.org/thread/198023, but no one has provided an acceptable answer yet.)


回答1:


The guide JBoss AS7 DS configuration says the recommended way is to configure the datasource by deployment

But according to discussion on the link Jboss 7 DS configuration JBoss Community Discussion on page 54 of the guide it mentions that the recommended way to deploy JDBC driver is to use modular approach

But I personally say that the better(not the best) approach to configure JDBC driver would be to use modules because of 3 reasons

  1. JDBC driver will generally not change.
  2. Re-usability : You can use the same module across various applications and not deploy the jar along with each application, this prevents duplicacy
  3. Space Effective : Using the module approach lets you reduce the size of your EAR/WAR as you do not need to supply the jar with the package

Hence I would argue that the better of the two approaches is via modules




回答2:


@Mukul Goel It's not necessary to include it the EAR of your application it's sufficient to put the .jar inside the deployments folder so:

no need to embed in ear no need to create a module

Jist deploy in deployments folder or via admin console



来源:https://stackoverflow.com/questions/16414426/configure-jdbc-driver-in-jboss-7-as-a-deployment-or-as-a-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!