This all works. However, I would prefer to define my DataSource in my web application's META-INF/context.xml as is done in (standalone) Tomcat, something like this:
I have been unable to get this to work. Does JBoss AS use the context.xml? If so, how do I define my DataSource there?
If I have simply missed the relevant section of the manual and somebody can point me to it, I would be grateful. [ August 21, 2008: Message edited by: Stephen Byrne ]
That is not possible. The only way of defining a datasource is with a *-ds.xml file.
Is it that you prefer to deploy just a single file, rather than two files? If so, you could package the *.ds.xml and war files in an ear. You would need a META-INF/jboss-app.xml file to reference the *-ds.xml.
Originally posted by Peter Johnson: Is it that you prefer to deploy just a single file, rather than two files? If so, you could package the *.ds.xml and war files in an ear. You would need a META-INF/jboss-app.xml file to reference the *-ds.xml.
In addition to wanting to deal with only a single file I would like the DataSource pool stopped and started when I redeploy the application. Will that happen if I deploy with a .ear?
2) Datasource pool restarted on redeploy - 80% confidence level. If you do not change the *-ds.xml file and thus the timestamp remains the same, I am not sure if the datasource would actually be restarted, but a quick test should verify if it is (you'll see it in the console log, and if you are using PostgreSQL you should see a new set of processes). If the timestamp on the *-ds.xml file changes a restart is guaranteed.