Scott Marlow [
http://community.jboss.org/people/smarlow] created the discussion
"Re: jboss7 quickstarts entitymanager injection question"
To view the discussion, visit:
http://community.jboss.org/message/635623#635623
--------------------------------------------------------------
Robert,
That is really an application level concern, whether each application has its own
datasource or uses separate datasources. If it helps, think of the data source, in terms
of database server connections. Each data source is capable of handing out a number of
database connections, that are used by the JPA persistence provider to
create/read/update/delete entities.
The H2 (
http://en.wikipedia.org/wiki/H2_%28DBMS%29
http://en.wikipedia.org/wiki/H2_%28DBMS%29) database and other database engines, are
capable of performing several operations at the same time, each occuring on a separate
database connection.
If two separate applications are sharing the same datasource, that just means they are
sharing the database connection pool associated with that datasource. The applications
could also be sharing tables or they could each have there own separate tables on the
database. Sharing tables, between applications is not an attractive idea but its been
done. When sharing tables, you would probably have to avoid caching data in memory (via
JPA second level cache) but otherwise, would work fine. If you can have a separate
database per application, that is wonderful but sometimes its not possible.
Scott
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/635623#635623]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]