How to achieve parallel processing in a single request?

Hi all,
I have a method in a Session EJB that will perform some business logic before it returns an answer to the client. The logic it will perform is to collect data from the applications database and two external systems, before sending all data to a third external system to get a response and send it back to the client. Each external system is quite slow so I would like to do all the collecting of data concurrent, parallel processing. How should I handle this? I'm not allowed to create my own threads in EJB's. Can I use MDB in some way? To the calling client this should be a synchronous call...
Greatfull for any suggestions
Cheers
Anders =)

Usually, the request is received by a component located in the web container, such as by an HTTP request (including Web Services). This component is able to start threads to allow parallel processing. Now, if for some reason the request arrives directly at EJB level and that you cannot move its receiver to web component, I think JMS is not a viable solution because you will switch to asynchronous processing and you have no way to make your EJB wait for the responses while preserving the client request (waiting implies programmatic life cycle management, which is forbidden in EJB container). Maybe a resource adapter (JCA) can bring a solution. A resource adapter acts as a datasource (a datasource is a specialization of a resource adapter) and thus it is a logical way to implement an adapter to an external, eventually non-J2EE, resource, as the name implies :) But I don't have enough knowledge in JCA to be sure of this.
Hope it helps.
Bruno Collet
http://www.practicalsoftwarearchitect.com

Similar Messages

  • How to do parallel processing with dynamic internal table

    Hi All,
    I need to implement parallel processing that involves dynamically created internal tables. I tried doing so using RFC function modules (using starting new task and other such methods) but didn't get success this requires RFC enabled function modules and at the same time RFC enabled function modules do not allow generic data type (STANDARD TABLE) which is needed for passing dynamic internal tables. My exact requirement is as follows:
    1. I've large chunk of data in two internal tables, one of them is formed dynamically and hence it's structure is not known at the time of coding.
    2. This data has to be processed together to generate another internal table, whose structure is pre-defined. But this data processing is taking very long time as the number of records are close to a million.
    3. I need to divide the dynamic internal table into (say) 1000 records each and pass to a function module and submit it to run in another task. Many such tasks will be executed in parallel.
    4. The function module running in parallel can insert the processed data into a database table and the main program can access it from there.
    Unfortunately, due to the limitation of not allowing generic data types in RFC, I'm unable to do this. Does anyone has any idea how to implement parallel processing using dynamic internal tables in these type of conditions.
    Any help will be highly appreciated.
    Thanks and regards,
    Ashin

    try the below code...
      DATA: w_subrc TYPE sy-subrc.
      DATA: w_infty(5) TYPE  c.
      data: w_string type string.
      FIELD-SYMBOLS: <f1> TYPE table.
      FIELD-SYMBOLS: <f1_wa> TYPE ANY.
      DATA: ref_tab TYPE REF TO data.
      CONCATENATE 'P' infty INTO w_infty.
      CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
      ASSIGN ref_tab->* TO <f1>.
    * Create dynamic work area
      CREATE DATA ref_tab TYPE (w_infty).
      ASSIGN ref_tab->* TO <f1_wa>.
      IF begda IS INITIAL.
        begda = '18000101'.
      ENDIF.
      IF endda IS INITIAL.
        endda = '99991231'.
      ENDIF.
      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
          pernr           = pernr
          infty           = infty
          begda           = '18000101'
          endda           = '99991231'
        IMPORTING
          subrc           = w_subrc
        TABLES
          infty_tab       = <f1>
        EXCEPTIONS
          infty_not_found = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        subrc = w_subrc.
      ELSE.
      ENDIF.

  • Parallel Processing for a single Package

    Hi,
    I have PKg1 that have mixture of For Each Loop container, DFT's and Seq containers and I want to run more than one thread for this package where i can process data in parallel.
    Please let me know how i can create this using SSIS 2012.
    Thanks,

    Hi,
    DFTs connected by precedence constraints  and I want to run this package more than once (multiple threads)  at a given point of time. is this possible? if
    yes, please let me know how I can achieve this.
    Thanks..
    If the DFTs are connected then there will be absolutely no parallel processing. Running the same package in parallel most likely result in a lock. It depends how it is architectured, but with a RDBMS in default installation or files it is not going to fly.
    When you have a DFT with say OLEDB destination each using its own connection, and they are not connected then each gets opened independently and thus allowing you to ingress data simultaneously.
    Arthur My Blog

  • How to achieve this process in SAP SD module??

    Hi,
    I want to know whether this kind of scenario could be achieved in SAP system SD module??
    We have only one material which the value or price is 10000USD, and this material could be only used 5 times. Everytime it is used, it will be goods issued in the system,  and its value will be decreased 2000USD, this means this material will be drawn back into system and its value will be showed as 8000USD.  And next time it will be 6000...4000...2000...0
    After 5 times this kind of process, then this material is no-used any more.
    I just want to know could 'Draw back' and 'decrease 2000USD everytime'  'show 'previous value - 2000' as new value every drawn back time' ....
    how to achieve this in SAP SD system??
    Thank you very much.

    Hi,
    This can be mapped in Foreign trade.You need to use Licensing functionality.Each  time you use it,  it  depreciate by document value.
    Thanks,
    Vrajesh

  • How to monitor parallel processing

    Hi All,
    I have 2 short questions:
    1. When we want parallel processing, we can either use a parallel hing in the query, or alter a table to be parrallel. My question is what is the difference in the following 2 syntax:
    a. ALTER TABLE myTable PARALLEL (DEGREE 3);
    b. ALTER TABLE myTable PARALLEL 3;
    Does the "DEGREE" keywor make any difference? or they both are same statements?
    2. When we enable parallel processing, how can we monitor oracle processes, to confirm that a certain table is being actually processed by multiple threads of a singe user process?
    An early response would be highly appreciated. Thanks.

    user566817 wrote:
    2. When we enable parallel processing, how can we monitor oracle processes, to confirm that a certain table is being actually processed by multiple threads of a singe user process?There are a number of virtual performance views that can be used. Please refer to the Oracle® Database Reference guide for details on these.
    Had a look though my scripts and I have this one.. cannot recall if I "borrowed" it from somewhere and customised it and how old it is.. but it should (hopefully) still be mostly correct. It uses the virtual view v$px_process to determine the list of current PQ slaves in the pool and if they are used, map them to the Oracle session using them.
    select  distinct
            x.server_name           as "PQ",
            x.status                as "Status",
            x.sid                   as "OraPID",
            w2.sid                  as "Parent OraPID",
            v.osuser                as "O/S User",
            v.schemaname            as "User",
            w1.event                as "Child Wait",
            w2.event                as "Parent Wait"
    from    v$px_process    x,
            v$lock          l,
            v$session       v,
            v$session_wait w1,
            v$session_wait w2
    where   x.sid =! l.sid(+)
    and     to_number (substr(x.server_name,3)) = l.id2(+)
    and     x.sid = w1.sid(+)
    and     l.sid = w2.sid(+)
    and     x.sid = v.sid(+)
    and     nvl(l.type,'PS') = 'PS'Use at own risk - best would be to verify that this is still valid using the Reference Guide. Or create similar ones using the available V$ views for the details you want to see (e.g. SQL statement executed per PQ, etc).

  • How to retrieve parallel process info (aRFC)

    Hi guys , I have a program that calls 2 RFC-enabled function modules and runs them in parallel. To my knowledge, each function modules is assigned with a unique task id when performing parallel processing.
    My question is, how do I retrieve the information on the individual process such as task name and its duration?
    say
    call function 'Z_XXX' starting new task 'A' performing 'Z_FUNC'  on end of task.....
    and
    call function 'Z_XXX' starting new task 'B' performing 'Z_FUNC'  on end of task .....
    then execute these functions and let it runs for a while, then how do i retrieve the task name of each process programmatically (A and B)?
    sorry I'm still pretty new when it comes to ABAP
    edit:-
    somehow my previous question was removed along with replies
    Edited by: afro100 on Aug 27, 2009 1:51 PM

    Hello,
    You can use following function module to get the id of transactional processing.
    CALL FUNCTION 'ID_OF_BACKGROUNDTASK'
    * EXPORTING
    *   DEST          = ' '
    * IMPORTING
    *   TID           =  --> collect ID from this varaible
    *   FNUM          =
    and for reteriving status you can use:
    CALL FUNCTION 'STATUS_OF_BACKGROUNDTASK'
      EXPORTING
        tid                 =
      tables
        errortab            =
    * EXCEPTIONS
    *   COMMUNICATION       = 1
    *   RECORDED            = 2
    *   ROLLBACK            = 3
    *   OTHERS              = 4
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Hope this helps!
    Thanks,
    Augustin.

  • How to manage parallel processing for queue JMS/MDB?

    Hello, we are developing a system in WebLogic Server 10g (10.3.0) that contains multiple JMS queues associated with each in an MDB. We need know how manage the parallelism of the message for each queue? for example:
    Queue 1: up to 4 messages in parallel
    Queue 2: up to 2 messages in parallel
    Queue 3: up to 5 messages in parallel
    Can also perform this configuration from the WebLogic Server Admin Console?
    Thank you very much,
    Lucas.

    Thanks a lot Tom for the reply, I have read about the descriptor setting 'max-beans-in-free-pool' and I searched this concept at the Administration Console without success.
    I suppose other way is create a “Session Pools” under the JMSServer, and then create a “Consumer” and define the setting “Messages Maximum”. One of the disadvantages is that “Session Pools” don’t support JTA, from the documentation:
    +Session pools enable an application to process messages concurrently. Session pools are now used rarely, as they are not a required part of the J2EE specification, do not support JTA user transactions, and are largely superseded by message-driven beans (MDBs), which are a required part of the J2EE specification.+
    I continue reading the MDB chapter of the performance and tuning guide in the documentation, thanks for any contribution to the topic.
    Lucas.

  • How to enable Parallelism process in 10.1.0.5 database

    Hi All,
    We have oracle database 10.1.0.5 running in windows 2003 server.
    I am trying to enable parallelism process in the database by including the following init parameters
    PARALLEL_AUTOMATIC_TUNING
    PARALLEL_SERVER
    PARALLEL_MIN_SERVERS
    PARALLEL_MAX_SERVERS
    But while i am trying to bring the database i am getting an error message like these parameter has been deprecated.
    Could anyone help me to enable parallel process in 10g database.
    Thanks in advance.
    Regards
    Aruna

    >
    I am trying to enable parallelism process in the database by including the following init parameters
    PARALLEL_AUTOMATIC_TUNING
    PARALLEL_SERVER
    PARALLEL_MIN_SERVERS
    PARALLEL_MAX_SERVERS
    But while i am trying to bring the database i am getting an error message like these parameter has been deprecated.
    >
    PARALLEL_AUTOMATIC_TUNING is deprecated since 10g. It's always true now. PARALLEL_SERVER is related to OPS (prior to RAC) and long time deprecated.
    You enable parallel query with an ALTER TABLE statement like
    SQL> ALTER TABLE SALES PARALLEL;or with a hint like
    SQL> select /*+ parallel(sales) */ * from sales;Kind regards
    Uwe
    http://uhesse.wordpress.com

  • Helps!:How to start multi process in a single java program?

    I wanna to test the querying performance of a Database
    connection poll,and here,not only multi threads,but also multi process I need to start in the same java program cause i have only one PC available.....
    Does that possible?

    In pure java this is not possible.
    A java program with all its thread run in a single
    jvm,
    which is just one process.However, you can have multiple instances of the jvm, I've done it w/ I needed to test some row locking in my database app. If you are in windows and want 3 copies of you program just make a bat file that looks likejavaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClassThat will create 3 instances of the jvm and thus three instances of your application. I'm sure the same can be done on multiple platforms.
    Peter

  • How to achieve parallel execution of two or more Entity Framework queries?

    Hi Everyone,
    I'm creating some WCF service that use EF to query the database for the data that I need. The problem I have at the moment is that I have 2 or more EF LINQ queries which are declared and then executed to bring back my data... but this is in serial. One EF query is issued, and then the next one after that.
    Does anyone know of a simple way to issue the queries in parallel? Or am I looking at async /parallel tasks to get the correct behaviour.
    I know the DBContext is not thread safe, so I have no problem in declaring multiple contexts if required.
    The code so far is as below:
    +using (IMyContext ctx = MyFactory.GetInstance(request.UserId)) {+
    Response response = new Response();
    response.customer = ctx.GetCustomerByAccount(request.data.Account);
    response.custInfo = ctx.GetCustInfoByAccount(request.data.Account);
    response.address = ctx.GetDefaultAddressByAccount(request.data.Account);
    return response;
    +}+
    Thanks in advance,
    Nick

    Hi,
    Although I don't understand why you need to serialized two programs
    that have no dependency on each other, maybe the following code can help provided the programs are executed using specific tcodes.
      DATA: BEGIN OF USR_TABL OCCURS 10.
              INCLUDE STRUCTURE UINFO.
      DATA: END OF USR_TABL.
    CONSTANTS: OPCODE_LIST LIKE TH_OPCODE VALUE 2.
      refresh USR_TABL.
      CALL 'ThUsrInfo' ID 'OPCODE' field OPCODE_LIST
        ID 'TAB' FIELD USR_TABL-SYS.
      sort usr_tabl by mandt bname.
    You can check wheter the other program(tcode) is being run from itab USR_TABL, good luck.
    Jeffrey Satriadi

  • How to implement parallel processing in oracle.

    Hi Gurus,
    In one our procedures we are calling 7 procedures internally. We want to execute them parallely insted of sequentially.
    Please help me to resolve this issue.
    thanks in advance...

    Hi,
    You have dbms_job package in Oracle 9i and dbms_scheduler from Oracle 10g.
    Though you can run all these procedures parallel submitting via dbms_job, any exception/error out in any of these procedures need to be handled explicitly. Just be aware that once you submit these jobs, your application loses control of the execution and you have to build a whole infrastructure for rerun in case of an exception(log/exception tables, monitoring application to periodically check the exception tables, alerts from procedures in case of an exception and so on ...)
    It's going to become more complex if you have any dependencies between these procedures.

  • How to get provisioning process tasks of a request with API

    Hi All,
    I need to know the number of process tasks called during a provisioning process for a resource object and also the status of each task!
    Which API is availabe for this?
    Does any one have a psuedocode?
    Regards,
    SK

    http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/Thor/API/Operations/tcProvisioningOperationsIntf.html#getProcessDetail_long_
    and
    http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/Thor/API/Operations/tcProvisioningOperationsIntf.html#getProvisioningTaskDetails_long_
    HTH,
    Bikash

  • How to send multiple files in parallel using ftp with single connection

    Hi.
    i have written code for file upload manager using ftp..
    it perfectly working with sequence file uploading in single connection..
    And i tried to upload multiple files with parallel processing in a single connection.... but it is not working properly.. i also used thread concept
    but single file only transfered and connection refused...
    my code here...
    //////////////////// main class //////////////////////////////////////////
    ftp.connect();
    ftp.login();
    String [] archivos = new  String[100];
                                      File dir = new File("C:\\Files Uploading\\");
                                       archivos = dir.list();
                                       for (int s=0; s<archivos.length;s++)
         //Start Data Transfer Here
         new DataTransfer(archivos[s]).start();
                                       Thread.sleep(1000);
    /////////////////////// thread class ////////////////////////////////
    class DataTransfer extends Thread
          String FileName="";
          String LocalPath="",RemotePath="";
           public DataTransfer(String fname)
         FileName = fname;
         LocalPath = "C:\\Files Uploading\\" + FileName;
         RemotePath = FileName;
         System.out.println(LocalPath);          
            public void run()
                        System.out.println("DataTransfer Started");
         /File Transfer Here
         try
               FileInputStream input = new FileInputStream(LocalPath);
                               Ftp_Client.storeFile(RemotePath,input);
         System.out.println("Successfully sent : " + RemotePath);
         catch (Exception exc)
              System.out.println(exc.getMessage());
              System.out.println("DataTransfer Ended");
         }otherwise tell me any other alternate way

    And i tried to upload multiple files with
    parallel processing in a single connection....
    but it is not working properly.FTP isn't a multiplexing protocol. How could it work at all?

  • Parallel processing for one large message

    I have some troubles from messaging performance perspective.
    Sender:ABAP Proxy
    Receiver:File Adapter
    I'd like use parallel processing for one large message.
    And the file for receiver is needed to be one file.
    Could you let me know how to set them ?
    Best regards,
    Koji Nagai

    Hi
    Can you elaborate your requirement more?
    How are you trying to achieve parallel processing in XI.
    Since you mentioned that the source is Proxy, there should be some trigger mechanism say selection screen, you restrict the values here and use append strategy in File and can execute the same.
    REgards
    Krish

  • Parallel Processing in CRM 5.0 for Customer download

    Hi
    I was referring to OSS note 350176 for implementing parallel processing. I wanted to achieve parallel processing for request loads for Customer download.
    Is it possible to achieve it by setting the parameter CRM_MAX_QUEUE_NUMBER_INITIAL in CRMPAROLTP or it can be achieved only through implementing exits?
    Thanks for your help in anticipation.
    Regards
    Karthik

    HI
    Karthik in Parralllel processing first you need to set up diffent filters for diffrent types of data basic or business data, customizing and condition data R3 AC1, R3 AC4, R3 Ac5 separately then start down loading the objects to CRM , remaning objects left over can be bypassed , then set the Satus of down loading Yellow red and Blue depends up on percentage of down load y for more than 100% R for more than 75%, B for less than 50%
    Reward if helpful
    Venkat

Maybe you are looking for

  • Can't remember my administrator password

    I cannot remember my administrator password so I am unable to download the necessary drivers to connect my laptop to my printer. How do I reset my admin. password, seeing as I do not remember the original password? Thank you.

  • S Drive does NOT return to navigate

    Hi All,      While trying out S Voice "Drive", I get the following bahaviour. If I am navigating, and then I get a call or text, the screen displays whatever necessary to handle the call or text. So far so good. But now when you complete the call or

  • Help, hi need agraphic software to slice web layouts

    in tiger i used an old photoshop elements 2, that dosn't work under leopard... i don't know wich software can be used... i just need to slice flat layout for web pages

  • IWeb crashes on Publish

    When I go to publish, either into .mac, or a folder iWeb crashes. When I go to use the inspector, iWeb crashes... What gives? I used it once before and it was fine, that was about 6 wks ago. I need it to get a site up for my sister's wedding today. H

  • [KDE 4.10.1] - Nepomuk prevents umouting of removable devices

    update: the same thing is happening again on KDE 4.10.1. This is something that has begun happening around KDE 4.9. The symptoms: 1) Plung-in a USB drive or a flash card with a few JPGs; 2) Open it with Dolphin; 3) Copy a few files to the hard disk;