I have a Conversation scoped bean, ComponenteM, that is injected in a Request Scoped bean, ComponenteC.
@Named
@RequestScoped
public class ComponenteC implements Serializable {
@Inject
ComponenteM componenteM;
}
ComponenteC has an export method that is invoked by an HtmlCommandLink (created programmatically). The export method calls a webservice that integrates with SAP BO webservice in order to export a report to excel. However, only when the call takes too long, I get a BusyConversationException. Every other export that is takes less that 10 minutes is successful.
I have no other call in the conversation meanwhile (AJAX or non-AJAX calls).
I've tried setting an explicit timout to the conversation bean when beginning the conversation but I read that it only works as a suggestion to the CDI container and it may be ignored:
public void beginConversation() {
if (conversation.isTransient()) {
conversation.setTimeout(60 * 60 * 1000);
conversation.begin();
}
}
The error is:
Root cause of ServletException.org.jboss.weld.context.BusyConversationException: WELD-000322 Conversation lock timed out: 1
I've also tried making the export request via thread and then returning the exported document to the conversation. My idea was to have one thread busy handling the exportation of the document and componenteC, while waiting for the thread to complete, would check occasionally do componenteM.beginConversation();
I'm trying to understand why a BusyConversationException is thrown even if there are no concurrent requests.
Thank you.