I'm doing a migration to JBoss AS 7.1 and Seam 2.3, but having some issues with JBAS014360: EJB 3.1 FR 4.3.14.1 concurrent access timeout on org.jboss.invocation.InterceptorContext
Here is my action class:
@Name("myAction")
@Scope(ScopeType.CONVERSATION)
public class MyAction implements java.io.Serializable {
@In(create = true)
private MyService myService;
@In(required = false)
@Out(required = true)
private User user;
@In(required = false)
@Out(required = false)
private Acquisition acquisition;
@Begin(join = true)
@Create
public void init() {
// more code
acquisition = myService.getNext(user);
}
public void saveHistory() {
myService.saveHistory(acquisition, user);
}
}
and a service class.
@Stateless
@Name("myService")
public class MyServiceImpl implements MyService {
@In(create = true)
private EntityManager em;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public Acquisition getNext(User user){
// em.createNamedQuery(...);
// acquisition.update(user);
// em.flush();
// return acquisition
}
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public Acquisition saveHistory(Acquisition acquisition,User user){
history = createHistoryObject(...);
acquisition.getHistories().add(history);
return acquisition;
}
}
getNext(User user)
method is called from the init()
block and it causes the exception.
saveHistory(...)
method is called from the xhtml page and works as expected.
What's wrong with the init()
block? Some change in EJB 3.1 or in Seam 2.3?
Can someone explain this?
I found a way for this to work.
If I just put the
@In(create = true)
private EntityManager em;
in MyAction.class
and nothing else, then everything works.
Still looking for explanation of this behavior.
Any ideas?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.