hi christian, as you might have seen in the comments, it is easy to move it to an own module (at any time).
based on what we have right now: ResourceLocalTransactionStrategy is the default implementation. if we create an own jta module, BeanManagedUserTransactionStrategy would be the default there. for using both in parallel, you just have to configure EnvironmentAwareTransactionStrategy. (we might merge BeanManagedUserTransactionStrategy and EnvironmentAwareTransactionStrategy after the corresponding discussions.) @ RESOURCE_LOCAL optimization: e.g. open-jpa supports such an optimization, but i haven't tested it in combination with EnvironmentAwareTransactionStrategy. we can test and discuss it for v0.4. regards, gerhard 2012/8/6 Christian Beikov <christian.bei...@gmail.com> > Hello there! > > I just saw the new commits related to the transaction stuff and somehow > felt unpleasant with the current solution. > IMO the transaction stuff should not be in the jpa module, but the jpa > module should for example offer a different strategy or so(jpa module > depends on transaction module). > I would suggest to move the transaction code into a transaction module and > add a hook or so in the transaction processing so that the jpa module may > do the special stuff with EntityTransaction. > > The strategy that uses the UserTransaction would need to be able to check > whether a JTA-Transaction is really needed(it is not needed in case that > only entity managers with transaction type resource local are active in the > current context) and if not, check if a different strategy could handle the > transaction stuff and use that instead. > I don't know if there is somehow a mechanism to retrieve all resources that > may participate within a JTA-Transaction for the current context, but that > would be needed to implement it in the way I explained. > > Any thoughts? > > Regards, > Christian >