Thread Management

I like that my emails are organized by threads. However, if there are emails with the same subject (i.e. HEY!), they are grouped together. Is there a way to separate a specific thread that I don't believe should be grouped together? I don't want all of my emails separate, just the few that have been wrongly grouped together because they share the same subject title.
HELP!

Greetings,
Sorry, but you can't separate mail from it's thread. Mail uses special headers in each email message to determine if a message belongs to the same thread. If these headers are not present, the subject is used to determine if a message belongs to the thread.

Similar Messages

  • Weblogic Thread Management

    Hello Buddies,
    We are facing performance problem in our J2EE application. For our application, Native Thread Management is enabled(EnableNativeIO=true).
    But, while starting the weblogic server(managed server), we are getting the following message.
    ####<Oct 16, 2008 12:40:25 PM BST> <Warning> <Socket>
    <wrohstsco10> <gc3-wrohstsco10>
    <ListenThread.Default> <<WLS Kernel>> <>
    <BEA-000402> <There are: 9 active sockets, but the maximum
    number of socket reader threads allowed by the configuration is: 8. You
    may want to alter your configuration.>
    Can any one suggest on this?
    Regards
    Senthil Nathan M

    you know that Native IO is enabled if you see "Native IO Enabled" in the server log at startup. This means that it founds the native IO shared libraries at startup.
    You've probably already seen this, but this is from the WebLogic docs, at <http://e-docs.bea.com/wls/docs100/messages/Socket.html>
    <strong>BEA-000402</strong>
    <strong><em>Warning: </em></strong>There are: <em>numSockets</em> active sockets, but the maximum number of socket reader threads allowed by the configuration is: <em>getMaxSocketReaders</em>. You may want to alter your configuration.
    <strong>Description</strong>
    A non-native IO is being used, and the number of
    socket reader threads is less than the number of active sockets.
    Performance may degrade significantly. It is recommended that you
    change the socket reader settings to improve the performance.
    <strong>Cause</strong>
    When non-native IO is used, IO is performed in a
    blocking manner. Therefore, if the number of socket reader threads is
    less than the number of active sockets, performance may degrade
    significantly.
    <strong>Action</strong>
    Increase ThreadPoolPercentSocketReaders and/or
    ThreadPoolSize, and/or decrease SocketReaderTimeoutMinMillis and/or
    SocketReaderTimeoutMaxMillis.
    This would imply what you understand. If you are seeing "Native IO Enabled" in your server log, but you are getting that warning, then I would first simply follow the advice in the message description that applies if you are using non-native IO. After experimenting with that (whether it works or not), I would file a support case asking first why you're getting that warning if you have native IO enabled, and whether following this advice for non-native IO should resolve your problem.

  • Weblogic's thread management

    Hi, I'm thinking on some issues related to Weblogic thread management.
    Suppose I start a thread (either on an startup class or from a servlet) that
    I want to perform some background work (I have readed it's out of the specs
    to start transactions from a thread launched in a servlet... yea I know it
    ;) ) well the problem is. How do I know when the Weblogic server is being
    shutting down?.
    I have seen on Weblogic's console that when an script like the
    ./stopWeblogic.sh one is executed it calls a Weblogic method in order to do
    that... then the Weblogic starts to destroy servlets, undeploys EJBs and, at
    the end a message like "Waiting 20 seconds for threads to stop" or something
    like that is written to the console.
    The question is, how does Weblogic notify the running threads that they
    should stop?, will it work for a thread launched in a startup class or from
    a servlet?, does the thread has to extend from an special Weblogic class?.
    If this isn't possible, would it work overriding the destroy() method of the
    servlet to call a method of the thread that stops it properly?. I know it
    will be called anytime the webapp is redeployed or if the servlet is hot
    reloaded, but it's fine to me.
    Thanks in advance, regards
    Ignacio.

    Hi, I'm thinking on some issues related to Weblogic thread management.
    Suppose I start a thread (either on an startup class or from a servlet) that
    I want to perform some background work (I have readed it's out of the specs
    to start transactions from a thread launched in a servlet... yea I know it
    ;) ) well the problem is. How do I know when the Weblogic server is being
    shutting down?.
    I have seen on Weblogic's console that when an script like the
    ./stopWeblogic.sh one is executed it calls a Weblogic method in order to do
    that... then the Weblogic starts to destroy servlets, undeploys EJBs and, at
    the end a message like "Waiting 20 seconds for threads to stop" or something
    like that is written to the console.
    The question is, how does Weblogic notify the running threads that they
    should stop?, will it work for a thread launched in a startup class or from
    a servlet?, does the thread has to extend from an special Weblogic class?.
    If this isn't possible, would it work overriding the destroy() method of the
    servlet to call a method of the thread that stops it properly?. I know it
    will be called anytime the webapp is redeployed or if the servlet is hot
    reloaded, but it's fine to me.
    Thanks in advance, regards
    Ignacio.

  • Thread management in servlet

    Here is the problem that i am trying to solve - and get better understanding of issues to look out for.
    1) Problem to solve
    Clients sends an http request to an distributor server. The request contains a list of tasks. Each such task can be sent to a particular handling server (out of a known set) which can handle the request. Each task has a task type, which identifies which server the request needs to be passed to. The responses from the handler servers are then to be collected and passed back the client as a consolidated response.
    On the distributor server, the servlet thread that is handling the request will
    a. need to spread the requests for various handling servers
    b. send the requests in parallel to handling servers
    b. get all the responses , consolidate and send back
    2)Proposed solution
    I was thinking of having a thread pool - one thread for each handling server, initialized within servlet . When the distributor server receives a request - the tasks would be spread to these handling threads. The distributor thread would then wait, until the handling threads notify.
    When a notification is received - the distributor thread will need to check if all responses are received. If not - it would need to wait (till a max_timeout) else return the response to client
    3)Questions
    - This involves waiting on the thread created by serlvet container (the distributor thread) and creating a threadpool. Thread creation and management by application in web-container is generally dissuaded - but given this issue - i see no other alternative
    suggestions ? Its been a long email - thanks for considering
    Fred

    How many clients for the entry server do you presume for the application ? I ask this because it is very possible that the server to remain without available threads and give errors. If you use different servers for the final requests I suppose that are some very time consuming processes. What kind of application are running on these servers so that you want to use this kind of distributed computing ?
    Why did you choose as an entry point a servlet container and http request for this kind of problem ? Do you need a graphic response in the browser ? If the response time is too long, the browser (Internet Explorer) will show exception and will not wait for the response (for this you must set some variabiles on client). Also the J2EE server must be set so that not to throw a time-out exception.
    To prevent these, you could do so that not to block the distributor thread and let it send the answer back to the client. Then you can tell to client browser to query the server from time to time to check the status of the execution (you can do that from javascript). When the execution is ready you can retrun the response to the client. Doing this way you will not block the application server threads.
    Now in the back end, you must somehow to take some identificators from the processes and sent them back to the client.
    You can use a database to make the bridge between the central server and the other processes (here you can put the processes identificators). When the processes end up they update their results in the database.
    The client, when will make the repetitive requests, will check the status of the processes in the database with given identificators.
    Sounds like an interesting project.

  • 9i Thread management

    I am involved in building an application using using Oracle9i App server, IBM MQSeries message queueing and Enterprise Java beans (to name a few things).
    The question I need to ask is:
    Does the Oracle 9i AS manage threading of things like JavaBeans?
    I need to find out if I can set a maximum number of threads so that even when thausands of messages are on the queue, it will only launch a certain number of threads to deal with them.
    Thanks to anyone who can shed some light!

    I am involved in building an application using using Oracle9i App server, IBM MQSeries message queueing and Enterprise Java beans (to name a few things).
    The question I need to ask is:
    Does the Oracle 9i AS manage threading of things like JavaBeans?
    I need to find out if I can set a maximum number of threads so that even when thausands of messages are on the queue, it will only launch a certain number of threads to deal with them.
    Thanks to anyone who can shed some light!

  • A Thread manages a connection from the outside--help me to finish it

    **RUN THIS CODE AND HELP ME--- THANKS A LOT**
    EchoClient is thread which manage a connection from the outside.
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.Random;
    public class EchoClient extends Thread {
         private ServerSocket listenSocket = null;
         private Socket manageSocket = null;
         private int[] port = new int[9999];
         private BufferedReader in;
         private PrintWriter out;
         private int line;
         private int count;
         // No needed to mention
                //private ClientNode[] clientArray = new ClientNode[9999];
         private ManageClient[] manageClient;
         private final int CONNECTED = 1;
         private final int CONNECTING = 11;
         private final int DISCONECTED = 2;
         public void run() {
              try {
                   manageClient = new ManageClient[9999];
                   listenSocket = new ServerSocket(903);
                   manageSocket = listenSocket.accept();
                   while (true) {
                        in = new BufferedReader(new InputStreamReader(manageSocket
                                  .getInputStream()));
                        out = new PrintWriter(manageSocket.getOutputStream());
                        line = in.read();
         // if Client send a variable(CONNECTING)
                // Server will send to Client a variable(CONNECTED) and port
                //to open a ChatFrame with that port
                        if (line == CONNECTING) {
                             System.out.print("have recieved");
              out.print(CONNECTED);
                         //randomize a port to send to client
              port[count] = (int) Math.ceil(Math.random() * 9999)
                        //creat a manageClient(Thread) to manage a seperate
                       // connection with a seperate Client
                             manageClient[count] = new ManageClient(port[count]);
                             manageClient[count].start();
                             out.print(port[count]);
                             count++;
              } catch (Exception e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              EchoClient e = new EchoClient();
              e.start();
    }And a Login Frame which will send to server a varialble (CONNECTING) which requires to connect and keep waiting for a variable to Open a ChatFrame with a new port
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    public class Login extends JFrame {
         public ChatFrame chatFrame;
         private final int CONNECTED = 1;
         private final int CONNECTING = 11;
          * @param args
         public Login() {
              // TODO Auto-generated method stub
              setSize(50, 150);
              JButton loginButton = new JButton("Login");
              JPanel p = new JPanel();
              p.setLayout(new FlowLayout());
              p.add(loginButton);
              add(p);
              loginButton.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        loginServer();
         public void loginServer() {
              try {
                   Socket connectSocket = new Socket("127.0.0.1", 903);
                   while (true) {
                        BufferedReader in = new BufferedReader(new InputStreamReader(
                                  connectSocket.getInputStream()));
                        PrintWriter out = new PrintWriter(connectSocket
                                  .getOutputStream());
                        out.print(CONNECTING);
                        System.out.println("At here");
    //(***position***)
                        int line = in.read();
                        System.out.println("At here1");
                        if (line == CONNECTED) {
                             int port = in.read();
                             chatFrame = new ChatFrame(port);
                             chatFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                             chatFrame.show();
                             connectSocket.close();
              } catch (Exception exp) {
                   exp.printStackTrace();
         public static void main(String[] args) {
              Login login = new Login();
              login.show();
              login.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }and this is ManageClient Thread...
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ManageClient extends Thread {
         private ServerSocket ssClient;
         private Socket sClient;
         private int port;
         public ManageClient(int port) {
              this.port = port;
         public int getPort() {
              return port;
         public void run() {
              try {
                   ssClient = new ServerSocket(getPort());
                   sClient = ssClient.accept();
                   while (true) {
                        BufferedReader in = new BufferedReader(new InputStreamReader(
                                  sClient.getInputStream()));
                        PrintWriter out = new PrintWriter(sClient.getOutputStream());
                        String s = in.readLine();
                        if (s != null)
                             out.print("have recieved");
              } catch (Exception e) {
                   e.printStackTrace();
    }my problem...
    At firts EchoClient will run.. and then Login but when I click to the Login button it has just only did before int line = in.readLine();(*** postion ***)
    I don't know why it doesn't continue. It stops here and the login button is still visible(cause code has not finish)..
    That's my problem...
    Somebody help me
    Edited by: rockfanskid on Oct 17, 2007 4:25 AM

    Somebody helps me to finish this project...
    thanks for racing this thread

  • Application manager: Thread management

    hi
    i've traced sun's javatv ri and i'm facing a problem about application management.
    The XletManager of the RI creates an XletThread which runs
    in a while loop:
    while(shouldRun) {...}
    After an xlet destroys, shouldRun is set to false thus this XletThread
    terminates gracefully.
    The XletManager has a request producer and consumer concept.
    In the while loop the thread keep looking for requests. If there is none,
    it waits. If there is one, it processes the request and then waits again.
    For instance, if user selects a service which contains an AUTOSTART
    xlet, a request is generated and the XletThread will execute the initXlet()
    implemented by the xlet. After the XletThread returns from initXlet(),
    it executes startXlet().
    Usually the xlet creates its own thread (UserThread) and do its work by
    the thread. Thus avoid blocking XletThread too long.
    Sorry for the long description and here is the problem:
    If the xlet has an infinite loop in initXlet() or startXlet()
    and it traps the XletThread forever, how does XletManager
    terminates XletThread?
    The CVM-PBP does not provide Thread.stop(), and obviously
    javatv ri's XletManager does not handle such situation.
    How to solve this problem if the VM is CVM-PBP?
    Hence, if the UserThread is also trapped in an infinite loop,
    how does XletManager identify the UserThread and also terminates it?
    I've read the book "Interactive TV standards" chap 4 but the author
    only states "Identifying all threads belong to an Xlet is not easy. And
    even all the threads are identified, it is still difficult to terminate
    them." The author does not mention how to solve the problems.
    Any reply is appreciated.

    In the general case there are no good solutions to this problem. Among the possible bad solutions are;
    - test all applications before transmission so this doesn't happen
    - reboot the Java VM if any calls to initXlet or startXlet (or event listeners) take more than some defined period (e.g. 10 seconds)
    - have multiple XletThreads so that if one Xlet blocks in an XletThread, the implementation can still start Xlets
    - have one VM instance per Xlet and kill the VM instance when an Xlet hangs
    The only good choice is a JVM supporting something like JSR-121 - the Application isolation API or something like the system described in this paper from Sun;
    http://java.sun.com/j2me/docs/cdc_appmgmt_wp.pdf
    Of course changing your JVM may not be an option.

  • Monitoring memory and thread management for Java 1.4.2_04

    Hi,
    I have an application which is using Java version 1.4.2_04. The application deployed in Customer site is having some memory issues. There are observing java.exe going 100% in Task Manager. The same application (of higher version)
    uses Java 1.5 is not seeing any issues.
    Now Customer needs the root cause of the issue and i would like to check the code which is causing the issue. I came to know we can monitor threads and memory using JConsole. Since we are using Java 1.4, i installed Java 1.6 on a remote machine and tried connecting to the problematic machine. But it failed to connect.
    i have added the option "-Dcom.sun.management.jmxremote.port=8880" when starting JVM (this i have provided inside ServletExec batch file, ServletExec is my web server).
    Any idea how to connect to the problematic machine from remote using JConsole. Or any other tools i can use on Java 1.4 to nail down the problem..
    Please provide pointers.
    I have another doubt on Java version 1.4, since there were many memory issues, am i hitting any defect in Java 1.4

    hari.r wrote:
    Please provide pointers.You need to tell you sales/marketing/business requirements people that they must come up with an end of life policy for customers on older versions.
    Unless your company has a service contract with Sun you right now, can no longer insure that the VM will remain secure nor even really running.
    See the following for the java VMs that you are using.
    [http://java.sun.com/products/archive/eol.policy.html]

  • Weblogic Threads Management

    Can anybody tell me how weblogic 6 manage threads? When it crerate a thread? When
    the threads finished??
    Or a document where I can read something about it???
    Thanks in advanced

    Creates on startup. Finishes on shutdown.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "D. L. I" <[email protected]> wrote in message
    news:3add567b$[email protected]..
    >
    Can anybody tell me how weblogic 6 manage threads? When it crerate athread? When
    the threads finished??
    Or a document where I can read something about it???
    Thanks in advanced

  • NDC and weblogic thread management

    Hi,
    we consider to use the Log4J NDC to log the Session ID of a request. The
    Session ID will be pushed/popped on each request entering weblogic server.
    Log4J binds this kind of information to the current thread. Is it reasonable
    to do this as long as there is no remote call of an EJB (which could be
    executed in another thread or server, of course)?
    Thanks!
    Raphael

    Hi Chuck,
    thanks for your answer. Log4J uses the current WLS thread and does not
    create a new one. Our problem was to know if WLS does some thread switching
    during the execution of a bean method. In that case the "contextual
    information" would be lost. In other words, is it legal to use
    java.lang.InheritableThreadLocal inside a EJB request?
    Bye,
    Raphael
    >
    Raphael,
    Isn't the Nested Diagnostic Context going to use the current WLS executethread
    for 'popping' and 'push' contextual information? In other words, I don'tthink
    it creates a new thread to perform this functionality. If that is thecase, I
    wouldn't think you would have an issue with this technique
    Chuck Nelson
    Developer Relations Engineer
    BEA Technical Support

  • Java Two Threads Synchronization Problem

    Hello to all, i have a scenario like this where a manager open a restaurant which signal the arrival of customer.
    Each entity here is one thread.
    How to signal the customer from manager that is open state ?
    I have a boolean variable (IsOpen) in manager class.
    My code:
    public class Manager implements Runnable {
         boolean IsOpen, IsStartWorking, IsLastOrder,
              IsClosingTime;
         public void run()
             try
                  // while not closing time
                  while (true)
                       if (!IsOpen && !IsStartWorking)
                            open();
                            startWorking();
                       prepareCappuccino();
                       prepareHotChocolate();
                       prepareFruitJuice();
                       // serve drink then refill Ingredients based on
                       // order
                       myCoffeePowder.refillCoffeePowder();
                       myCocoPowder.refillCocoPowder();
                       myMilk.refillMilk();
                       myFJ.refillFruitJuice();
                       Thread.sleep(100);
                  // Manager alert closing time
                  //closingtime();
                   //sanityCheck();
                   //statisticsDispaly();
                   //managerLeave();           
             catch(InterruptedException e)
                  e.printStackTrace();
              public void open() {
             IsOpen = true;
              System.out.println(dateFormat.format(cal.getTime()) +
                   " Thread Manager: Manager open Restaurant");
              //notifyAll();
    }I want to notify the customer thread when the IsOpen state become true.
    As you can see from open() method, there is notifyAll() but it turn error because it does not own the monitor.
    I have solution like this create a monitor with Isopen variable and once is open notifyAll().
    I never tried that.
    Please give some comment.
    The logic here is model using FSP like below
    MANAGER = (manager.open->startWorking->STARTWORKING),
    CUSTOMER = (manager.open->CUST_ARRIVE),manager.open is a shared action in FSP.
    Please help.
    Thanks.

    I think you had taken notify and notifyall in not correct way. According to me you need a another class say HotelManagement which hold the information of state of Manager and customer. This will hold the list of customer which are requsting to be allowed in hotel.So this class has methods like (Please pardon me for choosing some bad names ..I hope you will find some better names).
    1. updateStateOfManager() = which allow manager to Update its state. and if state become open it will take each customer from RequsetedCustomer list and call their allowed method. If state become Closed it will take each customer from RequsetedCustomer list and call their removed method.
    2. requestfromCustomer()= this method called by customer requesting for entry in hotel. if the state is open it allowed them immediately and kept in RequestedCustomer list too so that they can be removed when manager state changed. and if manager state is closed they are not allowed but kept in RequsetedCustomer list.
    3. finshedFromCustomer()= customer done in hotel so remove from RequsetedCustomer list;
    You can used AtomicBoolean objects for keeping state of Manager other thread safe data Structure for holding other objects.

  • I have a doubt about The Single-Thread Rule

    The [url http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html#rule]Single Thread Rule states:
    Rule: Once a Swing component has been realized, all code that might affect or depend on the state of that component should be executed in the event-dispatching thread.
    I began to wonder about this because so much code seems to work just fine when it isn't executed in the event dispatching thread. Why are there exceptions? I went looking for some code which acted differently when executed on the event thread than when it was not. I found this
    http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725
    Now I started wondering why this was the case. What I found was that DefaultCaret adds a document listener to the document of the JTextComponent. In this listener, the insertUpdate() method specifically tests if it is running on the event dispatch thread and if it is, it updates the caret position.public void insertUpdate(DocumentEvent e) {
        if (async || SwingUtilities.isEventDispatchThread()) {
            // ... update the caret position ...
    }I then copied the code from DefaultCaret and made a MyCaret. I needed to tweek the code a little bit, but it ran. I removed the event thread test. It worked outside the event thread. There was a small difference in the results though. The textarea did not scroll all the way to the bottom. Almost, but not quite. I didn't test enough to make sure this was the only problem, but there was at least one problem.
    Now I started think about why this would be. The thought crossed my mind that the order of the events which were posted to the event queue were probably important. Sun found bugs when components were updated out of the event thread, so they essentially ignored events which weren't on the event thread and created the The Single-Thread Rule.
    A few days pass. I'm starting to wonder if Sun could have done a better job making Swing components thread safe. I also don't know that this specific case I found was the rule or the exception to the rule. But without insight into the design philosopy of Swing, I would have to examine all their components and see how they have written them and see if I can come up with a better design. That sound like a lot of work. Especially without getting paid for it.
    But wait a second, all you have to do is call the append() method of JTextArea on the event thread. If that is the case, why didn't they write the freakin component that way? Well, I'll try itclass MyTextArea extends JTextArea {
      public MyTextArea(int rows, int columns) { super(rows,columns); }
      public void append(final String text) {
        if (SwingUtilities.isEventDispatchThread()) super.append(text);
        else {
          SwingUtilities.invokeLater(new Runnable() {
            public void run() { myAppend(text); }
      private void myAppend(String text) { super.append(text); }
    }I change [url http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725]camickr's code to use a MyTextArea and it works fine without calling from the event thread. I've essentially moved The Single-Thread Rule to the component itself rather than relying on each and every one of the [url http://www.aboutlegacycoding.com/default.htm?AURL=%2FSurveys%2FSurvey6intro%2Easp]2.5 million Java programmers worldwide to use SwingUtilities.invaokeLater().
    Now for my question...
    Why didn't Sun do this?

    Swing is slow enough as it is. Lets not make it slower
    just
    because dense "programmers" don't know what they are
    doing.I agree with you in defending the current model, but aren't you a bit harsh there?!? ;-)
    Well, there are a number of not-so-dense programmers that expect such high-level components to be thread-safe. The question is worth asking whether Sun intentionally favor the explicit thread management for performance reasons, or whether this was an oversight.
    I'd go for the former (intentional) : indeed any GUI toolkit is inherently thread-based; there is always a distinction between the graphical thread(s) and the application threads - and the programmer always has to manage explicit thread creation to handle long-running event handlers without blocking the event dispatching thread. Extending thread concerns to the updating of components is therefore not a big move.
    So it seems fair that a core GUI toolkit does not hide thread issues (though to the best of my knowledge there is no such limitation in updating AWT components), or at least that's what Sun deemed.
    An ease-of-use-focused toolkit wrapping the core toolkit for thread-safety can be provided as a third-party product. Though I agree that wrapping the dozens of existing widgets and hundreds of methods is cumbersome - and the lack of such products probably shows it would have a low added value to trained developpers.
    Because your way is an extra method call and if
    statement, neither of which is necessary if you already know you
    are in the correct thread. Now count the number of methods
    which will need to be changed (and add up the extra cost).Indeed it's quite common to update several properties of several widgets in one bulk (when user clicks "OK", add a row to the table, change the title of the window, update status bar, re-enable all buttons, change some color,...).
    In this case explicit thread management doesn't spare one if but a dozen of redundant ifs!
    Note that there could have been if-less ways to cope for thread safety, such as creating a copy of the component's model when a change is made to a component, and switching the model only before paint() is called in the event-dispatching - of course coalescing all changes into the same "updated" model until paint() is called.
    But this would trade ease of use for redundant memory consumption, especially for some components with potentially huge models (JTree, JTable, JTextArea,...). And Swing appears to be already quite memory-greedy!

  • Call EJB from a thread , pb with lookup

    Hello,
    I have seen taht it is possible to call an EJB within a thread that can act as a client. But in my case when the thread calls the EJB method the lookup failed. I do exactly the same like if I call the ejb from an external client.
    In my case I have got the following architecture:
    one MDB which receive a message the pass the a "manager of thread" which select a thread and then this thread calls a session bean. Everything goes well until the thread call the EJB method and at this time the lookup fail. I call from local interface as I constructed my jar with all this components inside, i.e the MDB, the thread manager, threads and the session bean.
    I tried to call the session bean from the MDB in the same way I have done from the thread and in that configuration its ok.
    Is there a specific manner to lookup an ejb when we want to call it from a thread or simply this configuration is completely impossible?
    Thanks for any advice

    insert the following code before creating the InitialContext:
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

  • Problem regarding servlets+ threads

    <meta http-equiv=\"refresh\"" " content=\"5\" ";URL=\"\">";
    Iam using meta refresh tag for refreshing browser for every 5 seconds.
    When i invoke doPost () then iam creating thread and for every 5 sec it calls doGet() .
    If i close browser then servlet is not invkoing but thread is running
    How to stop a thread when we close browser?

    iam using Tomcat
    <Connector acceptCount="100"
    connectionTimeout="20000"
    disableUploadTimeout="true" port="8080"
    redirectPort="8443" maxSpareThreads="75"
    maxThreads="150" minSpareThreads="25">
    </Connector>
    his is ok.Ignore my first post.
    Your problem has nothing to do with the containers thread management.
    Is there any way to excute following method
    Thread.currentThread().destroy(); or stop when i
    close browserPlease see malcolmmc's great post (i.e, the browser refresh is driving things - you shouldn't need a thread in the servlet).
    Servlets are blocking request / response based: When you've written a response, you're done. They are not connection based - and there isn't (and shouldn't be) any direct way to know when a connection has gone

  • Changing thread count in WebLogic 10.3

    Hi
    We have migrated from WebLogic 8.1 to 10.3.
    how do i change the thread count in weblogic 10.3? i saw options in weblogic 8.1 and 9.2 but not in 10.3.
    Can anybody throw some light on this.

    From WL9.0 onwards, the Weblogic thread management mechanism is changed.Now no need to set the thread count. WLS itself is intelligent enough to do the self tuning of the thread pool.
    To prioritize and schedule your application requests,you can create work managers and can associate request classes/constraints.You can refer the below article to understand the workload management using work managers.
    http://www.oracle.com/technology/pub/articles/dev2arch/2006/01/workload-management.html
    Inigo Prince

Maybe you are looking for

  • Free game count against the limit

    So I purchased Disney magic world and Mario tennis for the 3ds. When I checked out Mario tennis total said 23.99 with Gamers club unlocked written underneath the price. Disney was free do the total said $0.00 with nothing underneath the price. My que

  • How to make copied text appear in the correct order?

    I have a PDF document with text created from a Photoshop file. There were multiple text layers in this Photoshop document. Problem: When I do "select all text" in Acrobat and then "copy" and then paste it into a text editor the text is pasted out of

  • How to use's mail's "perform mail action with message"

    I can't for the life of me figure out how to use "perform mail action with message", I basically want to create a script that get's used on a rule from Mail, but nothing I try will work. This is what I started with... tell application "Mail" perform

  • What driver for the TM2t touchpad?

    Hi, I have a HP TM2t-1000 running Windows 7 Pro 64 bit.  I am in the process of doing a clean reinstall of the operating system and software.  I used the bare Win7 install from the MS website, not the HP recovery CDs. I wondered if there is a prefere

  • ITunes optimizing 6000+ photos every sync

    I'm running the current version of iTunes (although it happened under the previous version as well) on Windows Vista Ultimate 64-Bit edition, and each and every time I sync, iTunes wants to re-optimize and re-sync every one of my 6000+ photos. Two iP