0 Replies Latest reply on Feb 21, 2013 4:46 PM by 989585

    Weblogic work manager is showing synchronous behavior

      Weblogic 10.3.5 and java 1.6

      There are two Workmanager tasks configured for CreateServiceAgreement flow:
      1.     ScheduleWriteServiceAgreement flow
      2.     ScheduleAlternateTask flow

      Expected behavior: These two are getting called in doExecute() method of CreateServiceAgreement operation and each of these flows is designated to be async as a separate thread gets instantiated by the WorkManager for these workItems. The caller is supposed to get the control back once they are set in WorkManager queue.

      Actual behavior: Tested several times and looks like the flow is synchronous and the main caller (doExecute()) is waiting until it gets the response from both the tasks – main flow is starting the alternate flow and the main flow is getting resumed after the alternate flow ends.
      Response object is populated twice – alternate flow first and main flow is overriding the alternate flow’s response.


      EJB module level workmanager is configured in ejb-jar and weblogic-ejb-jar files

      Whenever the build is deployed before via weblogic console there used to be a warning :

      <20-Feb-2013 1:44:11 o'clock PM EST> <Warning> <WorkManager> <BEA-002919> <Unable to find a WorkManager with name WorkManager-Online. Dispatch policy WorkManager-Online will map to the default WorkManager for the application ClientServiceAgreementService_v4_0>

      We have changed the weblogic-application.xml file to include the <work-manager> element to make it visible at the application level rather than EJB module level.


      This configuration when deployed is not giving any warning on the console and the application workload monitoring tab is showing that the deployed ear is using “Workmanager-Online”.

      However, createServiceAgreement webservice call is still behaving synchronous.


      Then I create a global work manager via weblogic console without any request class and constraints applied just workmanager is created and the requests are getting served using workmanger-online only but in synchronous fashion. How the workItems are actually handled?


      CommonJ code:

      CreateServiceAgreementType newRequest = new CreateServiceAgreementType();
      PropertyUtils.copyProperties(newRequest, request);
      ic = new InitialContext();
      WorkManager workmanager = (WorkManager) ic.lookup("java:comp/env/WorkManager-Online");
      CreateServiceAgreementAlternativeTask task = new CreateServiceAgreementAlternativeTask(newRequest);
      WorkItem csaItem = workmanager.schedule(task);
      Collection<WorkItem> workCollection = new ArrayList<WorkItem>();
      workmanager.waitForAll(workCollection, WorkManager.INDEFINITE);
      } catch (NamingException e) {
      logger.warn("scheduleAlternateTask", e.getMessage());
      } catch (Exception ee){
      logger.warn("scheduleAlternateTask", ee.getMessage());