Support more DataSource flags w.r.t JTA
Currently, the default is the enlist in the work unit (and hence re-use along the workunit) or not at all.
Enlisting in the workunit "transparently" integrates with JTA. But sometimes this is not desired as the current behavior may create long-running transactions unintendedly (just some activity outside of a JTA tx).
It would hence be nice to support the following additional behaviors:
a) Require JTA transaction present ("JTA transaction required")
This is useful, if you really want to manage transaction demarcation and fail hard, if there is none.
b) Enlist in workunit if there is a JTA tx, otherwise return an autocommit connection ("JTA supported")
This is useful, if you are ok with non-TX stuff but still want to have control over TX demarcation.
Now a) has a downside: Some utilities (e.g. flyway, quartz) can be used with JNDI data sources but will not integrate with JTA.
For those exceptional cases, the data source lookup could be performed with a specialized marker interface (?type=...NonJTARequiringDatasource, ?type=JTAOptionalizingDatasource etc).
Updated by Henning Blohm about 8 years ago
- Status changed from New to Rejected
As it turns out, supporting an arbitrary JTA impl with some specific pool is not really going to work well.
Instead: Use z2 jta as a simple pseudo-distributed JTA impl, switch completely to Atomikos or the like otherwise.
See als How_to_TransactionManager.