Andrig Miller wrote:
In the batch processing methods I use the entity manager that is configured for batch processing, and in the other methods I use the one configured for OLTP processing.
This is all working, but when I was reading various sources for whether this "should" work, it wasn't clear.
So, while it does work, what I am wondering, is this spec compliant, or is this just dumb, blind luck that it works?
It's definitely not luck :) I don't see anything wrong in what you are doing.
One thing that you might want to keep note is to make sure that you don't end up using both those entity managers in the same transaction - in which case you would be enrolling 2 transaction aware resources (the datasource corresponding to the entity managers) in one transaction. You would then require XA datasources for such cases.