Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Ignore Cache on Query

Hi,

Having two persistence-unit's could do the trick I suppose but I
wanted to avoid that as there's a bit of redundancy there.

I went with the solution proposed by Samba, the only change I had to
make was getting rid of the @TransactionAttribute on the method as
Glassfish complained that it wasn't allowed on  EJBs defined as
@TransactionManagement(TransactionManagementType.BEAN)

Thanks for your help, problem solved.

Zarar


2010/1/19 Swierzynski, Rafal <Rafal.Swierzynski@xxxxxxxxxx>
>
> 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ł
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users



--
Zarar Siddiqi
416-737-9024


Back to the top