Judicious use of transactions prevents problems when multiple connections might access the same data. However, the conflicts will happen whether or not you use a single configuration file, because each webapp will have its own pool of connections, and each connection might talk to the same table at various points.
To avoid this (not that you particularly need to), you can use an application server or similar, and have a single application for accessing the database. Other applications would then request data access from that application.
I recommend gonig with separate configuration files. This allows you to have different timeouts, connection pool sizes, etc. for different webapps. It also means that you can customize which mapping files are loaded by which app, to speed up startup times for apps that need only a small subset of availabe tables. My strategy has been to include a configuration file in each jar that my webapps use, then use either the jar="" attribute (undocumented, unfortunately) of the mapping element in the configuration file, or add the relevant mapping files to the Configuration object programmatically, during webapp startup. So all apps get the UserSecurity jar, several get the EmailRecords jar, and each app will have a small selection of jars specific to itself.
There is no standard for this sort of thing. There are probably as many solutions are there are development teams that have encountered the issue.
_________________ Code tags are your friend. Know them and use them.
|