]
Jeff Yu commented on RTGOV-161:
-------------------------------
I am thinking about using the H2 embedded connection (file based), which seems to support
JTA.
Sorry that I didn't solve this question directly, but if I make it jta working with
H2, that might be easier according to your research. :)
I am going to try it first now, and then report it back.
Regards
Jeff
Simplify db configuration
-------------------------
Key: RTGOV-161
URL:
https://issues.jboss.org/browse/RTGOV-161
Project: RTGov (Run Time Governance)
Issue Type: Task
Reporter: Gary Brown
Assignee: Jeff Yu
Priority: Critical
Fix For: 1.0.0.M5
In the M4 release, there were two persistence-unit definitions, one for a JTA datasource
and one for a non-JTA datasource. All details are the same for both, the only difference
is whether the datasource is JTA.
This was necessary, because using H2 out of the box (for simple initial usage), only
supports non-JTA.
Specification of which entity manager (i.e. persistence unit) to use is defined in the
overlord-rtgov.properties file.
Ideally there should just be a single persistence-unit, and the data source (whether JTA
or not) should be defined in a single place (i.e. overlord-rtgov.properties).
However when the datasource info is moved to the properties file, it causes a problem as
hibernate is being used to populate the schema for the H2 db. This appears to be causing
hibernate to create its own entity manager, which does not take into account the
properties in the overlord-rtgov.properties file. However that is the file where the
"hibernate.hbm2ddl.auto=create-drop" property is defined???
If it is possible to remove datasource from persistence.xml, then it may also be good to
package the persistence.xml in the activity-store-jpa module? rather than when building
the overlord-rtgov.war.
Main reason this has become an issue is that there is now a JPA based event processor,
where the user can specify the entity manager, and persist received events. However when
using the H2 db, it again becomes necessary to define a second persistent unit for the
non-JTA datasource, and change the entity manager (i.e. persistence unit name) depending
upon the db used in the event processor's configuration.
So would like to simplify the whole approach so that persistence-unit only lists the
classes, and the datasource, dialect, etc are all defined in one place (preferrably the
overlord-rtgov.properties file), so that when switching between H2 and JTA dbs, the
details only have to be changed in the one place.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: