Additional information on the <data-source> tag in web.xml

I was looking for something standard about the DataSource configuration for a Java EE application, but everything I found on the Internet was container specific (example: context.xml with Tomcat).

I found this very rare item about the <data-source> . See the links inside, it is very interesting. I could not find more information in the Sun / Oracle documentation.

So, I have a few questions:

  • Does the <data-source> with all web servers? (Cat, JBoss)

  • Several resources. Can we have more than one <data-source> tag in web.xml?

  • Do I need to use the <resource-ref> (for @Resource annotation) in the web.xml file when we use the <data-source> or is it not necessary?

  • When we call a DataSource with "InitialContext" or "@Resource", is this the same instance for every call? If so, is it more like an EJB Bean @Stateless session (which could possibly be the same instance) or more like an EJB Bean @Singleton session (should it be the same instance)?

  • I understand that the <data-source> appeared with Java EE 6 standards, but where can I find more information about this? Which JSR?

thanks

+6
source share
1 answer

You can use the JSR88 API to view applications containing Java EE 6 data sources.

0
source

Source: https://habr.com/ru/post/971491/


All Articles