Ejb calling ejb, how many threads?

A few of questions regarding the way WLS threads EJBs:
1. It seems straightforward if I deploy a WLS "application" that's composed of
a single EJB. I suppose that the app runs as a thread within the WLS JVM and "pooling"
also makes sense.
2. But what about an "application" that's composed of 2 EJBs, one calling the
methods of the other. Is each EJB ran in its on thread? It seems like they would
have to be in order to "pool" them or does the "pooling" affect the entire "application",
i.e. you don't pool the individual beans but the entire app?
3. How is all this affected by using local interfaces for the EJB-to-EJB method
calls?How does this affect pooling and threading within WLS?
Thanks.

Hi Jack,
"Jack Ottofaro" <[email protected]> wrote in message
news:[email protected]..
A few of questions regarding the way WLS threads EJBs:
1. It seems straightforward if I deploy a WLS "application" that'scomposed of
a single EJB. I suppose that the app runs as a thread within the WLS JVMand "pooling"
also makes sense.It just seems because you have the question number two :)
2. But what about an "application" that's composed of 2 EJBs, one callingthe
methods of the other. Is each EJB ran in its on thread? It seems like theywould
Actual EJB code runs within a thread that first began
processing of the request. So you may have two cases.
First, if the bean is colocated (belongs to the same jar
or ear) with the caller, by default it will be a local call
and the bean will run within a caller thread. Second,
if it's remote call, it will run within "its own" thread.
have to be in order to "pool" them or does the "pooling" affect the entire"application",
i.e. you don't pool the individual beans but the entire app?I'm not sure I understood the question.
3. How is all this affected by using local interfaces for the EJB-to-EJBmethod
calls?How does this affect pooling and threading within WLS?Local interfaces buys nothing but mess. By default all calls to
the beans residing in the same application , even if they are
declared as EJBObjects, are optimized to be local so that
parameters are passed by reference and are not subjects of
serialization.
Hope this helps.
Regards,
Slava Imeshev

Similar Messages

  • How many  threads are running?

    here's the code... i am trying to understand, at each point, how many threads are running:
    I understand that one thread belongs to the caller of the start()
    & at the same time there is another thread belonging to the instances of each thread (thread1, thread2, thread 3 etc.)
    1public class ThreadTester {
    2   public static void main( String args[] )
    3   {
    4      PrintThread thread1, thread2, thread3, thread4;
    5
    6      thread1 = new PrintThread( "thread1" );
    7      thread2 = new PrintThread( "thread2" );
    8      thread3 = new PrintThread( "thread3" );
    9      thread4 = new PrintThread( "thread4" );
    10
    11      System.err.println( "\nStarting threads" );
    12
    13      thread1.start();
    14      thread2.start();
    15      thread3.start();
    16      thread4.start();
    17
    18      System.err.println( "Threads started\n" );
    19   }
    }can you tell me if i am counting the number of threads in existance correctly...
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1.........1.......2
    14..............1+1......1+1.....4
    15..............2+1......2+1.....6
    16..............3+1......3+1.....8
    so by the time line 16 executes i have a total of 8 threads,
    4 threads belonging to each caller plus
    4 threads created by start()
    or is it
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1........1........2
    14..............1........1+1.....3
    15..............1........2+1.....4
    16..............1........3+1.....5
    after line 16 executes does the caller thread die, thus leaving only a total of 4 threads?
    there is only one thread belonging to the caller at line 13(plus the thread it creates).
    at the start of line 14, the previous callers thread is dead & now a new thread is created that belongs to the caller on line 14... etc.

    well, i realize at the end there would be 4 threads but im trying to get my head around this explanation in the book:
    "A program launches a threads executioin by calling the threads start method, which in turn call the run method. After start launches the thread, start returns to tis caller immediately. The caller then executes concurrently with the lauched thread." there fore if i have 2 concurrent processes, are there 2 threads running????
    now having said the above, my question was:
    for each line,
    how many threads are in existance at
    line13
    line14
    line15
    line16
    thanks.

  • How many threads can be running at the same time

    Hi!!
    Dows anyone knows how many Threads can be running at the same time in the JVM.
    I'm making a multi thread client-server app and I would like to know how much simultneous connections the JVM support. I'm using one Thread per connection.

    Hi, thanks to all for your answers.
    I think that I made the wrong question, as you said: "that means the number of threads currently created".
    I'm worry about this because my application is already online (It's a mail server -SMTP and POP3 server using ORACLE for the users database- ) and some other user post in the "multi-tread forum" that almost any JVM can only have 700 threads created at the same time, and I've never heard or read anything about this.
    what you mean with the stack space (memory??)
    I'm using the JavaWebServer 2.0 and a servlet to start the main Thread.
    Again Thanks to all for the answers but I think that the schapel answer is the one that solve my doubt...

  • How many Threads on a given system ?

    Is there a way to know for an AIR application how many threads a given system system supports?
    Pixel Bender is capable of real multi threading. It would not make sense to run 4 instances on a system with only 2 threads, but would be a shame not to utilize all threads of an 8 core hyper threading system.
    Thanks,
    David

    This appears to be a Flex question. Please try the flex forums http://forums.adobe.com/community/flex/flex_general_discussion

  • How Many Threads inside JVm while running

    Hi,
    how many threads will be there in jvm of 1.4 or higher sdk? threads i mean it includes all jvm threads also.

    How do you identify these threads?
    I can see 8 threads in my 1.5 java process (just running a main) using windows XP task manager, but when I check how many threads there are from within the code, it only looks like 4:
    java.lang.ThreadGroup[name=system,maxpri=10]
    Thread[Reference Handler,10,system]
    Thread[Finalizer,8,system]
    Thread[Signal Dispatcher,9,system]
    java.lang.ThreadGroup[name=main,maxpri=10]
    Thread[main,5,main]
    For example, using
    Thread.currentThread().getThreadGroup().getParent().list();

  • How many thread can I create?

    I wrote a multithread program. I use Excutors class and newCachedThreadPool method to create a thread pool.
    I want to create max threads that i can. In some where, I saw Max thread that is allowed, depends on OS, availabe memory, JVM.
    I use SUSE 11.1 as operating system, have 3.75 GB RAM & 7.5 GB swap & use jdk 1.6
    I want to create max threads that i can. I don't know how many i can create.
    please help me.

    Hi _Security, Mutli-Threading isn't always a good thing, because of the constant switching the processor has to do, causing it to be slower then it could be if you properly queued your tasks instead of threading each one. Each thread you create is another thing your processor has to execute each cycle, so if you have tons of threads, your processor will have to execute and switch through each one every cycle, making it bog down performance by a long shot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How many threads can be created in a java swing program?

    At first, I intend to use Timer to create a 2D plot repeatedly after a certain number of milliseconds. This is for an animation. However, I discover that it takes a lot of time to generate each 2D plot frame ( about 700 milliseconds on a 1.13 MHz computer, this is a complicated plot requiring a lot of computations). So I think I should use SwingWorkers, that means a new thread for each generated graph image. There might be 1000 images to be created, and thus there might be thousands of threads in my programs. I would like to know if there is any limitation on the number of threads generated in a program so that it will be safe, or is it ok to generate as many threads as you want, as long as you follow strictly the syntax of creating threads?
    I would be thankful if someone can give me some advice.

    as there is no restriction in the Language Specification (http://java.sun.com/docs/books/jls/second_edition/html/memory.doc.html#28457) i would think it's theoretically indefinit. of course, it has a maximum because of your memory. ;-)

  • EJB calling EJB - Very very slow in iAS

    We have an EJB deployed to the iCache instance of iAS that calls another EJB on the same instance.
    We experience serious performance problems when executing this call. The response time is up to 3 Minutes !!!
    Are there any configurations that I have to change to make this performant?

    I just noticed in the error message, this line that says :
    NestedException: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: ADMIN2.XTLKEYSBEAN
    the table is ADMIN2.XTLKEYS, not ADMIN2.XTLKEYSBEAN. could this be the problem? Where is the table name defined in the EJB set up?
    Thanks!
    -PA

  • How many threads are used to load an webpage in webview?

    I implemented a custom version of cookiemanage to overcome the problem of cookies being stored retrived in the same place for webview (when assigning a custom cookiemanager to default cookiehandler before initializing webview ).
    This custom class uses thread local to create a new store for each thread, so i could have varius webview instance not using the same cookiestore.Well, it doesn´t work because
    webview apperantly creates about 20 threads for loading (login) a webpage.I´m guessing webview uses several threads to load an webpage, because in my custom implementation of cookiemanager each thread that request
    CookieHandler.getdefault() get a new cookie store, i did this with threadlocal.
    My question to the experts is ::
    - Is my teory correct and weview creats several threads to load a page or i´m missing something where?
    - Also having my problem is there an way i can restrict webview so it only creates one thread or at least only one thread that call cookiemanager.getDefault()?
    Even not knowing the answers to the above , any details on webview inside working relating thread could be helpfull.
    Many Thanks
    André

    To print all Threads;
    class Equitus {
        public static void main(String[] arg) {
            new Equitus().run();
        public void run() {
            ThreadGroup tg = Thread.currentThread().getThreadGroup();
            for(ThreadGroup parent; (parent=tg.getParent()) != null; tg=parent) ;
            Thread[] threads;
            do {
                threads = new Thread[tg.activeCount()];
            } while (tg.enumerate(threads)!=threads.length);
            System.out.println(java.util.Arrays.toString(threads));
    }

  • Find out how many threads in a Java program

    Why do I get ID 20, ID 21, ID 22 by runing the following code? I would like to know if i acturely create a thread then stop it probably. somehow i need to call it two more times in my program.
    start() and interrrupt() are default thread methods. when I call start() it goes to my run() method. I am worry about if the thread 20 and 21 are still doing something after creating thread 22
    main = new Thread(this);
            System.out.println("ID " + main.getId());
            main.start();
            main.interrupt();
            main = null;
            main = new Thread(this);
            System.out.println("ID " + main.getId());
            main.start();
            main.interrupt();
            main = null;
            main = new Thread(this);
            System.out.println("ID " + main.getId());
            main.start();
            main.interrupt();
            main = null;

    Here is my code, I would like to know if I implement my threads nicely here, I am worrying those threads are still alive, they should be interrupted. but why I got different thread ID, when i resume it?
    // Two player board game play in turn. Human plays first as red, the computer plays
    // second as blue. I used thread here for repainting the applet, because the computer
    // evaulation function is quite slow, the gui won't draw human player's move until it
    // finishs calculating computer's move. the solution i use is interrupting the current
    // thread, let the gui repaint before calculating the computer move.
    // Board.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Board extends Canvas implements Runnable, MouseListener {
        private Thread main;
        private int state = 0;
        private double aMove = 0;
        public void init() {
            addMouseListener(this);
        public void run() {
            removeMouseListener(this);
            main.interrupt();
            main = null;
            repaint();
            // calculate computer's move, then making move
            // this is a slow evalution function goes here
            for (int i = 0; i <10000000; i++) {
                aMove = Math.pow(0.1,1000000000);
            state = 1;
            repaint();
            System.out.println("Blue makes a move on postion " + aMove);
            state = -1;
            addMouseListener(this);
        public void paint(Graphics g) {
            System.out.println("paint");
            if (state == 1) {
                g.setColor(Color.blue);
                g.fillOval(0, 0, 20, 20);
            if (state == -1) {
                g.setColor(Color.red);
                g.fillOval(0, 0, 20, 20);
        public void mouseReleased(MouseEvent e) {
            // human player makes a move on postion 0;
            aMove = 0;
            System.out.println("Red makes a move on postion " + aMove);
            state = -1;
            repaint();
            // Why the following gives me different thread here every time?
            main = new Thread(this);
            System.out.println("Thread ID: "+ main.getId());
            main.start();
        public void mousePressed(MouseEvent e) {
        public void mouseEntered(MouseEvent e) {
        public void mouseExited(MouseEvent e) {
        public void mouseClicked(MouseEvent e) {
    // appletdemo.java
    import java.applet.*;
    import java.awt.*;
    public class appletdemo extends Applet{
        Board b = new Board();
        public void init() {
            System.out.println("start ");
            setLayout(new BorderLayout());
            this.add(b);
            b.init();
            setVisible(true);
    }

  • Downloading package with pacman, how many threads?

    When I download packages with pacman it start at slow speed and then goes up,  this produces some kind of delay between downloads, especially for lots of small packages. I know this can feel like not a big problem, but you know, comparing with yum centos it seems kinda slow, seems like pacman download packages 1 thread at a time while yum it is like multi threaded because every package is downloaded consequentially without speed loss. Is there somekind of tweak for this?
    Last edited by natostanco (2012-04-28 10:16:13)

    There's a nice entry in the wiki about this, although I'd use Xyne's pm2ml instead of powerpill-light.  https://wiki.archlinux.org/index.php/Im … oad_Speeds http://xyne.archlinux.ca/projects/pm2ml/

  • How many threads used by EventDispatcher?

    Hi,
    I have a number of clients inserting entities to Coherence 3.5.3 distibuted cache. The cache has thread-count=10. On the cache I have MapListener which asynchronously invoked on entity insertion and process it further. It looks like only one thread is used for insertion processing (DistributedCache:DistributedCache-Message:EventDispatcher). And, under heavy load, I see some insertion events are lost. (This issue desribed by Patric Peralta in his blog a bit: http://blackbeanbag.net/wp/2009/07/20/coherence-3-5-service-guardian-deadlock-detection/). is it possible to manage/increase a number of event processing threads and prevent throttling of events?
    My cache config, just in case:
    <distributed-scheme>
    <scheme-name>distributed-message-scheme</scheme-name>
    <service-name>DistributedCache-Message</service-name>
    <serializer>
    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
    <init-params>
    <init-param>
    <param-type>String</param-type>
    <param-value>pof-config.xml</param-value>
    </init-param>
    </init-params>
    </serializer>
    <listener>
              <class-scheme>
                             <class-name>spring-bean:messageMapCoherenceListener</class-name>
                   <init-params>
                   <init-param>
                   <param-name>setCacheName</param-name>
              <param-type>java.lang.String</param-type>
         <param-value>{cache-name}</param-value>
    </init-param>
                   </class-scheme>
    </listener>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <internal-cache-scheme>
    <local-scheme>
         <expiry-delay>30s</expiry-delay>
         <flush-delay>30s</flush-delay>
                                       <high-units>512</high-units>
                                       <unit-calculator>BINARY</unit-calculator>
                                       <unit-factor>1048576</unit-factor>
    </local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
                                  <class-name>spring-bean:msgCacheStore</class-name>
    <init-params>
    <init-param>
    <param-name>setCacheName</param-name>
    <param-type>java.lang.String</param-type>
    <param-value>{cache-name}</param-value>
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    <rollback-cachestore-failures>true</rollback-cachestore-failures>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    <thread-count>10</thread-count>
    <autostart>true</autostart>
    </distributed-scheme>
    Thanks, Denis

    Hi Denis,
    We do not have a mechanism to process map events in multiple threads. I would suggest using the Java 1.5 Executor service (http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Executor.html) and dispatch processing to a thread pool in your MapListener implementation.
    Thanks,
    Patrick

  • How many reocrds update in call transaction method and session method

    The flat file having the 10 records but the flat file having the 5 th record is error so in session method how many records will  update and in call transaction how many records  will update.
    can you provide with detailed information  like in synchrnous mode and asynchronous mode
    Regards
    reddy

    hi,
    session method :up to 4 records will be updated as it is in synchronus mode.
    Call transaction method : except 5 th all 9 records will be updated as it is assyncronous method.
    Regards
    sandeep Reddy

  • How many active threads in JVM?

    HI,
    Is there a way to find out all the running/active/blocked/unknown threads in a JVM?
    Doesn't matter if it is through code or some external command.
    I use jdk1.4 on Red Hat Linux.
    Thanks and Regards
    suri

    HI,
    Is there a way to find out all the
    running/active/blocked/unknown threads in a JVM?
    Doesn't matter if it is through code or some external
    command.
    I use jdk1.4 on Red Hat Linux.
    Thanks and Regards
    suri'jdb' tool lets you know how many threads exist in an application. try these command
    compile your program with '-g' option.
    jdb <classname>
    stop at <classname>:<line no of main(){}>
    run
    threads
    You can notice four threads. But I guess in linux, it might show lots of verbose with thread ID, If possible pls post the result for us to see.

  • How   many will update in BDC.

    In bdc flat file having  10 records.but 5th record having error.in call transaction how many records will update.
    can any body explain on MODE wise means if put the mode A how many records will update.mode E ,mode N. and explainn fore ground and baground.

    Hello ,
    Mode
    A Display all
    E  Display errors only
    N  No display
    If u set the mode as 'A'.
    U will see all the screens when the processing is being done.
    If u set the mode as 'E'
    U will see the screen only if the screen has errors or else the processing will take place internally.
    If u set the mode as 'N'
    U will not see any screen irrespective of error or success.
    These modes are regarding the processing for foreground.
    Now coming to ur example :-
    If u set the the update process as  one of the below :
    update> : Update mode:
    S Synchronous
    A Asynchronous
    L Local update
    Let's see :-
    If u set as S
    the update will happen if it's error free
    If u set as A iirespective of the errors all the records will get updated
    If u set as 'L'
    This is with respect to number of Application servres.
    Regards,
    Deepu.K

Maybe you are looking for

  • My plugin is not working when "out-of-process plugins" ("OOPP") is enabled

    Plugin is working fine with FF3.0 but it is not working with FF4.0 and above. The reason I found out is in about:config dom.ipc.enabled is set to true. This means it whitelists the plugins to run in a plugin container. When I disabled the dom.ipc.plu

  • Sales Order (VA01)- Addtional Data Tab B Request

    Hi All,, This is sales order(VA01) relevant and I have added the new "ZZFIELD" field in the "Additional data B" which i kept screen painter attributes check box chosen "Input Field" and Input "required". When i am creating sales order(VA01), the mome

  • Inner joins

    Hi i got struck up at the below code. i want to move all my data into strans table. FORM RETRIEVE_DATA .   CLEAR: WA_MKPF.    SELECT CPUDT CPUTM XBLNR FROM MKPF INTO ZMKPF WHERE CPUDT IN     S_DATE.   CLEAR:    WA_LIPS.     If Zmkpf-cpudt = s_date-lo

  • Making run automatically

    can some one help me making it run automatically and adding slideshowTimer on the codes below next_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame); function fl_ClickToGoToNextFrame(event:MouseEvent):void     nextFrame(); previous_btn.

  • OS X Mountain Lion & Apple TV

    Hi, I have a mid 2011 mac running OS X Lion 10.7.5 and I have just purchased an apple tv. I can not get the apple tv icon at the top of my screen but I can get it in itunes. My question is, if I pay the $21 to upgrade to OS X Mountain Lion will I get