|
|
Re: Weird problem of persist in another transaction [message #989684 is a reply to message #989616] |
Fri, 07 December 2012 10:07 |
khalil haddad Messages: 12 Registered: November 2012 |
Junior Member |
|
|
I'm testing a business component which is intercepted by a Spring AOP method, and the problem occurs in this method :
@Around("execution(* net.diamis.mph.server.component.impl..*.process(..))")
public Object processService(ProceedingJoinPoint pjp) throws Throwable {
// --------------------------------------------------------------------------
// GESTION DES TRACES SERVICE ==> PROCESS ==> INSTANCE: DEBUT
// --------------------------------------------------------------------------
AbstractEvent event = (AbstractEvent) pjp.getArgs()[0];
Instance instance = StartRouter.getInstance();
Process process;
Date startTime = new Date();
// Pour les tables d'Audit
LogUtils.username.set("SERV-" + instance.getInstanceCode());
// Recuperation du workflow auquel appartient le process
Long workflowId = ((AbstractComponentImpl) pjp.getTarget()).getWorkflowId();
// Création de l'objet process
process = new Process();
process.setWorkflow(workflowDAO.findById(workflowId));
process.setInstance(instance);
process.setStatus(ProcessStatus.pending.toString());
process.setStartTimestamp(startTime);
process = processDAO.immediateSave(process);
...
}
In my DAOs, entity managers are injected like this :
@PersistenceContext(unitName="MPH")
protected EntityManager em;
And I didn't set any cache. Should I?
[Updated on: Fri, 07 December 2012 10:07] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03682 seconds