[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
AW: [eclipselink-users] Ignore Cache on Query
|
Hi. The transaction management type is a persitence-unit wide setting, so you cannot normally change from JTA to RESOURCE_LOCAL or vice versa for a given entity manager, or even entity manger factory. Maybe EL has this possibility, but it would be specific to EL, so not portable (if you care about JPA1/2 portability, that is).
We had a similar requirement to this one in one of the previous projects I worked on - we used JPA to do our logging to the database (a LogEntry was an entity with some simple relatons), and we wanted to log any exceptions and so on, so obviously a JTA unit was no good as it would be rolled back for certain exceptions. What we did was to create 2 persistence units, one JTA for the bulk of our business logic, and one RESOURCE_LOCAL, just for the logging. Where we needed it, we would inject both EntityManager(Factory)s and work with that. Maybe this will be helpful for you.
Regards,
RafaĆ