I am trying to simulate sequential threads ...

Hi ,
I am trying to simulate a load testing scenario on our Java Connector Implementation ( JCA) through a test class.I would have loved to use a load testing tool like JMeter but unfortunately JMeter doesn't have built in JCA sampler.
Basically I am trying to simulate multiple sessions and each session would be comprising multiple requests to the Application server . I want to simulate multiple requests belonging to a session as multiple threads that run sequentially one after another and uses a common connection object to simulate calls to the connector.
All is ok. I know it will be a Thread within Thread kind of program... But the point where I am stuck is how do I ensure that all threads that are simulating requests to the app server(ie requests within a sibngle session) run sequntially ? I am seeing that all the threads are starting in parallel which I want to stop. Any code snippet will be highly useful.

subhrajyoti wrote:
If I am not wrong every requests(within a session) from the broswer to an application server is a separate thread . each of these these threads run sequentially .
I want to simulate the same thing. So I need threads .Each request from (the same or different clients) will cause the creation of a new thread ON THE SERVER.
I think this is where you are becoming confused, you have stated that multi-threading is occurring on the browser/client, it is not (necessarily) the case, the multi-threading is happening on the server.
Also please spell-check your text before posting it.

Similar Messages

  • Iphone 5 - I am trying to delete message threads and once I do, I go to text someone else and it won't send. HELP? I just don't want those messages on my phone anymore.

    Iphone 5 - I am trying to delete message threads and once I do, I go to text someone else and it won't send. HELP? I just don't want those messages on my phone anymore. I have tried to restart my phone but when I do, the "deleted" threads show back up on my phone. I use iOS 7.1.

    Hello Makayla,
    It sounds like you're deleted message threads keep coming back after you restart the devie. I recommend starting by quitting all the running apps on your phone:
    iOS: Force an app to close
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it. 
    When you have done that restart the device and test the issue again:
    iOS: Turning off and on (restarting) and resetting
    If the issue persists, backup your device to iTunes and then restore it as a new device and verify that it works. 
    How to erase your iOS device and then set it up as a new device or restore it from backups
    If it does, then restore your backup to either verify it still works and the software just needed reinstalled, or isolate the issue to the backup file itself. 
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • I am trying to simulate the robot voice synthesizer sound that is produced by that electronic voice simulator after someone as had their voice box removed.   The vocal transformer insert in Logic Pro doesn't quite do it.   Suggestions?

    I am trying to simulate the robot voice synthesizer sound that is produced by that electronic voice simulator after someone as had their voice box removed.   The vocal transformer insert in Logic Pro doesn't quite do it.   Any Suggestions?

    Try one of the Audio Voice Effects like Alien / Cosmic / Robot… etc. to start with…
    Adjust the Settings in the Inspector to your liking…

  • Hi all, i can't sync over wifi between my iPhone 4 and Windows 7 64 bit, wifi sync works with the same phone and my Windows 8 machine, tried solutions from other threads with no luck, just thought i'd see if anyone else had any ideas, thanks.

    Hi all, i can't sync over wifi between my iPhone 4 and Windows 7 64 bit, wifi sync works with the same phone and my Windows 8 machine so the problem seems confined to Windows 7. I've tried solutions from other threads -
    Making sure everything is allowed through firewall
    Rebooting phone/laptop/router
    Disabling ipv6
    Disabling all networks except the one curently on
    Re-installing iTunes
    Restoring iPhone
    No luck with any of those unfortunately so i just thought i'd see if anyone else is still without wifi sync after trying those as well and if you ever found a fix, thanks.

    I just wanted to leave a note that it's working now. I'm not sure if it was the latest iTunes update that got it working or that i decided to start a new library instead of using the one i had backed up on Windows 8 (it didn't occur to me to check using the old library when i re-installed iTunes). But if anyone is having this problem, it might be worth trying again with a new installation of iTunes to see if the latest update works for you, and if not, try using a fresh library instead of a backup (by fresh library i mean discard your old library completely and start a new library, not just restore as new iPhone, a whole new library).

  • Trying to simulate a MANET

    I need a code that simulates a mobile ad hoc netwrok among 20-30 computers and also the ability to pass message among those computers. I have tried to solve the problem by studying JAVA Documentation. But I am lost. So if some one could get me started (By giving me any sample code on this matter) then I would be highly obliged..
    Thnak you.

    Don't cross post.
    http://forum.java.sun.com/thread.jspa?threadID=5168300

  • Trying to learn about threads

    Hi guys,
    I'm trying to learn more about threads......i've written a small program for a better understand, but i don't understand the order of the output i'm getting:
    public class testme {
    public static void main(String[] args) {
    Theshape mover = new Theshape("go");
         mover.start();
    System.out.println ("checkpoint 1");
    System.out.println ("checkpoint 2");
         }//main
    }//class testme
    class Theshape extends Thread {
    public int count;
    public String thego;
    Theshape (String gg){
         thego= gg;
    count=0;
    }//constructor
    public void run(){
    try {
    do{
    System.out.println (thego);
    sleep(1000);
    System.out.println ("johnny");
    count=count+1;
    }while(count<8);
    } catch (InterruptedException e) {}
    }//run          
    }//class theshape
    ........the output i get is:
    checkpoint 1
    checkpoint 2
    go
    johnny
    go
    johnny
    go
    johnny
    go
    johnny
    go
    johnny
    go
    johnny
    go
    johnny
    go
    johnny
    I would like to know why "checkpoint 1" and "checkpoint 2" is printed first, even though the call to the run method is made before the two statements. i would have thought that the two checkpoint statements would be printed last.
    Can anyone help?
    Thanks,
    Zaf

    After you've issued the 'mover.start()' call, a new thread pops into existence. The first thread (your main thread) continues to run while the second thread prepares itself to start up. On your machine, this startup takes a (little) while, so your main thread is able to print those two line just before the other thread is able to print something. That's all there is to it. If you put a 'Thread.sleep(1234)' between those two println statements in your main thread, the output would probably be a bit different. Give it a try.
    kind regards,
    Jos

  • PB 1.67 HiRes - chimes, won't boot. Tried suggestions in other threads.

    sorry -- I hate cross-posting but i'm not getting many hits in the "Using..." forum.
    I've tried everything I can find here and elsewhere to get it to boot.
    The powerbook chimes and the screen stays black. - No beeping as you would expect with memory problems. HD and optical drives make less sound than they should, for a minute or so. and then it's only fans whirring, it's dead quiet in there.
    I've disconnected the optical drive and the PRAM battery, which I suspect was dead anyway. I learned from other threads that PowerBooks do not need a PRAM battery to boot, but a dead PRAM battery can keep your mac from booting. The replacement battery is very expensive so I've just pulled it for now.
    With optical drive disconnected, the HD only whirs faintly for 20 seconds but does not seem to be loading the boot sequence.
    I've tried replacing the HD with a fresh HD, containing a cloned backup of a PB system (same model) - thought at least that would boot. Did not.
    I've tried unseating the RAM and reseating it, and I've tried putting RAM in ONLY the upper or ONLY the lower slot. Still no boot, and no beep either.
    I've reset the PMU. I've tried PRAM reset (before removing that), and OF reset, and many other key combinations at startup chime. None had any noticeable effect.
    When optical drive was connected, it whirred indecisively but did not spin up.
    I discovered a DVD stuck in the drive, which I have removed by disassembling the drive, but when reconnected, the drive whirred exactly as before.
    I've also DiskWarriored the original HD and it's in good shape, with the directory rebuilt.
    Thanks in advance if any of ye troubleshooters have any advice.

    The powerbook chimes and the screen stays black.
    Have you hooked up an external screen to see if it's a display issue? If you look really carefully, can you see anything faintly on the Powerbook screen?
    I've tried replacing the HD with a fresh HD, containing a cloned backup of a PB system (same model) - thought at least that would boot. Did not.
    Have you tried booting to an OS X disk in the DVD drive by holding the C key down?
    Have you tried a safe boot holding the option key down?
    Do you have an external firewire enclosure you can mount the hard drive in, and reboot holding the alt/option key down, then choosing that?
    Have you tried the Apple hardware test, where you insert the first OS X disk that came with your system and reboot holding the alt/option key down, choose AHT, and choose extended test when prompted?
    If the answers to those questions are all fail, then it sounds like your logic board has failed.

  • Java.lang.IllegalThreadStateException - Trying to restart a Thread

    Hi, since I'm new to this forum, I'll start right off with a question.
    I'm trying to create an application, which guides the user trough several windows. In the first window there is some user input, and frame2 opens. frame2 then opens, depending on user input, frame1 (restart the cycle) or frame3.
    I tried this with Threads, a Thread for each frame to keep things less complicated (less messy etc.).
    Now the problem:
    When I try to restart frame1, I get the error "java.lang.IllegalThreadStateException". The source code:
    public class Sss extends Thread
        (public variables that can be changed or used by other classes)
        public static frame1 a = new frame;
        public static void main(String[] args)
            a.start();
    public class frame1 extends Thread implements ActionListener
        //several public static variables/object for the frame etc.      
        public frame1()
        public void run()
              //create the frame, add objects, add actionlisteners
        public void actionPerformed(ActionEvent e)
            //several buttons redirected to different methodes
        //several methodes
        public void end() //is called in a method
          frame2 p = new frame2();
           p.start();
        } This still works, but then:
    public class frame2 extends Thread implements ActionListener
    //several public static variables/object for the frame etc
        public frame2()
        public void run()
    //create the frame, add objects, add actionlistener
          public void end()
                if(a)          //boolean a is true or false
                    frame1 q = new frame1();
                    q.start();
                else
                     frame3 w = new frame3();
                     w.start();
    public void actionPerformed(ActionEvent e)
            //several buttons redirecting to different methods
    } In the end method, "q.start();" gives the error. Am I doing something wrong? Shouldn't I be using Threads at all, should I try something different(what, how?)
    I'm a student from The Netherlands, 18 years old, and I'm going to study "technische informatica" (don't know what it is in English, sorry, but it involves programming ;)). I've worked with Java on a low profile the last two years, learning & exploring, my most difficult application made is an ChatProgram (client/server based, in a local network). So this gives you my level in programming a little bit, I hope ;)
    If someone is able to help me, please.
    Niek

    Niekfct wrote:
    Well it's not actually helping me, you're posting things what I've already found out. And I can't imagine you've put a lot of time in such an answer. But if someone DOES post a usefull answer, i will be grateful for it. So if someone can help me, please.
    And with help I mean, maybe an other way to do this, maybe a way to slightly adjust the existing classes to make it work.
    (Please don't look at me as if I'm some lazy boy who can't figure anything out by himself. I'm trying to help others, and I hope others will help me.)Uhm, how are you trying to help others with this?
    Also, how is pointing out that the path you are currently taking is pointless and a waste of time not helpful. At the very least it should cause you to stop even attempting to continue along that path, and prompt you to take a step back and try to look at the problem from another angle.
    Jeesh, instead you just, essentially, say "Shut up! I know what I'm doing!". Well, that sounds like you really wanted help. Sounded more like you wanted confirmation, not help.
    In any case, why don't you simply get rid of all references to threads, and simply change all but the main frame to JDialogs?
    From what I can I see, of what you have posted here, that should be more than enough.
    Just make sure, of course, that you don't mix your business logic into your GUI. Which you must have be doing currently, since a GUI class, in and of itself, has absolutely no reason to need it's own thread. It wouldn't help anything regardless of how you looked at it.

  • Trying to simulate USB-6366 device (without success)

    I have read through the MAX and DAQmx tutorials regarding device simulation but I still can't find a way to effectively simulate the acquisition and generation of a signal using a NI-USB-6366 device. 
    I'm trying to capture a signal (given at the input of this VI) using DAQmx Write and then use DAQmx Read to read the captured signal from the internal memory of the card (which has a buffer of 32 MS). For this I created a task with DAQmx that I feed into the Write block.
    I know the approach is most likely wrong, but I just can't figure out how to do this in an easy way and the NI documentation is everything but straightforward. All I want is to
    a) test the capture of this signal by the device using 2 digital inputs and then read out what it has acquired from its internal buffer
    b) send this same signal to 2 digital outputs and capture this output signal again.
    Cheers
    Solved!
    Go to Solution.
    Attachments:
    usb6366 test.vi ‏20 KB

    Yes! the simulation is meant to allow you to write a program and test that it works theoretically even if you do not have the hardware physically available. It has no programmatic interface to influence what simulated data the read functions will return. And any write function has no noticable effect anywhere, working as a data sink into nirvana. It's still usefull as you can test software without getting all kinds of runtime errors about trying to access non existing hardware, but has its limitations of course. However a programmatic interface to manipulate what and how data is simulated, while it would be a very nice feature, is almost certainly to complicated not only to implement but also to use.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • IPhone 4S AND 5S freeze when trying to delete message threads?

    I have the newest software available and both phones are up to date.
    When I go to delete old message threads, my iPhone freezes. It will let me swipe to the side and clear them, but after 2 or 3 threads it will freeze. I'll be in the Messages section and it will be unresponsive. I will close out of it and then when I reopen it- it says I have 0 messages altogether.  I have to literally turn my phone off and then back on to view my inbox again- and the message threads I thoght were deleted are still there.
    Does anyone else have this problem, or a way to fix it?

    Hello Makayla,
    It sounds like you're deleted message threads keep coming back after you restart the devie. I recommend starting by quitting all the running apps on your phone:
    iOS: Force an app to close
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it. 
    When you have done that restart the device and test the issue again:
    iOS: Turning off and on (restarting) and resetting
    If the issue persists, backup your device to iTunes and then restore it as a new device and verify that it works. 
    How to erase your iOS device and then set it up as a new device or restore it from backups
    If it does, then restore your backup to either verify it still works and the software just needed reinstalled, or isolate the issue to the backup file itself. 
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • Trying to simulate OTA download

    Hi
    I try to run a MIDlet on JBuilder X developer from a OTA server.
    I configured the jar and jad in the server.
    1) I get this error:
    " ** Error installing suite (49): The suite is not authorized for javax.microedition.io.PushRegistry "
    2) when running another application with no registry the process doesn't fail but I don't get the download option like in the J2ME Wireless Toolkit.
    please help , thanks

    thanks for the info.
    still it doesn't simulate the download of the jad , as I run my project ( with JBuilder ) the application is already started , no option to download it.

  • Trying to simulate button click via ActionScript

    Hello,
    I've got code written to tell if a user is hitting his/her
    left or right arrow keys. I currently have a "next" button named
    realNext, and a "back" button named realBack. Both buttons have
    lots of code written in their on(release) functions. How can I
    utilize ActionScript to simulate a button click?
    Here's my code thus far:

    I have never had success **** this by calling the onRelease
    or onPress event functions. So to get around this I define other
    functions that do all of the work and then just use the onRelease
    and onPress event functions as callers.
    For example.
    button1.onRelease = myFunction;
    function myfunction():Void {
    // code goes here
    Now with this I can either press the button to ge thte code
    executed or I can "simulate" the button being pushed by just
    calling myFunction().
    Tim

  • Trying to 'simulate' an array of strings

    In pseudo-code what I would like to do is this:
    Array[x][3]
    Array[1][1] = "First"
    Array[1][2] = "Data1"
    Array[1][3] = true
    Array[2][1] = "Second"
    Array[2][2] = "Data2"
    Array[2][3] = false
    counter = 1
    while(counter < 3) {
    print Array[counter][1]
    counter++
    In Java-think I created a class of data, and wanted to create a series of elements (array) of this class. But, suprise, my code snippit below doesn't work....
    class DataSaved {
    String InputName;
    String InputValue;
    boolean IsHidden;
    public class test {
    public static void main(String [] args) {
    DataSaved dataum;
    int counter = 0;
    dataum = (DataSaved) DataSaved.firstElement();
    dataum.addElement("first","1data",true);
    dataum.addElement("second","2data",true);
    dataum.addElement("third","3data",true);
    dataum.addElement("xxxfirst","4data",true);
    dataum.addElement("fxxirst","5data",true);
    dataum.addElement("sixfirst","6data",true);
    dataum.addElement("7first","7data",true);
    dataum.addElement("8first","8data",true);
    dataum.addElement("9first","9data",true);
    // move to the top element
    datum.firstElement();
    while (counter < 6 ){
    System.out.println(dataum.nextElement());
    counter++;
    So....what am I not understanding, and how can I make this snippit work?

    Great, now your DataSaved class is correct.
    The next step is how to deal with arrays.
    Suppose you have an array of Strings. Here's how it looks like:
    String[] myArray;Before you can use it, you have to actually occupy the space it needs. (Arrays are objects in Java, so basically, but sloppily speaking, you have to instantiate an "array class"):
    myArray = new String[15];The length of the arrays in Java is constant. You have to tell the length during construction time, and you won't be able to change it later.
    Also, if you create an array as above, each of the elements will contain null (were it an array of primitive types, it would contain the appropriate version of zero for that primitive type). Therefore, you have to load the elements one by one:
    myArray[0] = new String("first string");
    myArray[1] = new String("second string");
    myArray[14] = new String("last string");As you see, indexing starts with zero. I also have to note, that "new String(...)" is an unnecessary and in most cases poor programming technic, the string constants would do in this case (but not if the array is not an array of strings but array of some kind of objects).
    Another note. It's usually a bad programming technic to reach the fields of another class. Sometimes we do, but only when we have good reason. It's better if you provide setXXX and getXXX methods, and let your fields to have private access:
    class DataSaved {
       // your current code appears here
       public void setInputName(String name) {
          InputName = name;
       public String getInputName() {
          return InputName;
    }Now, your cycle which retrieves the values should look something like this:
    for (int cntr=0;  cntr<myArray.length;  cntr++) {
       System.out.println(myArray[cntr].getInputName());
    }That myArray.length is an attribute of the arrays, which tells you the length of the array. Now, if you have to change the length later, you don't have to scrutinize your code, since the "magic number" appears in the code exactly once.
    You may read about the arrays and how they're handled in Java here:
    http://java.sun.com/docs/books/tutorial/java/data/arrays.html
    That ArrayList is another story; if you have succeeded with your array, come back and ask. "Preview": ArrayList is a way how to deal with arrays which might be expanded and shrunk as needed.
    You also might consider reading the tutorial about the collections (perhaps in a later time):
    http://java.sun.com/docs/books/tutorial/collections/index.html

  • Thread.sleep() behaves weird in Listeners

    Hey,
    I am a rookie in Swing and I am writing a small game. The game is a two player game. I am now trying to add AI to the game so when the human player clicks on the board he plays and then the computer plays its turn.
    So in pseudo code:
    //in action listener
    human.play
    robot.proceed
    sleep(3000)
    reprint the board
    robot.proceed
    sleep(3000)
    reprint the board
    robot.proceed
    sleep(3000)
    reprint the board
    where proceed is a method that makes the robot play on three stages...
    So basically I am trying to simulate the actual way a human plays...
    The problem is that when the human player clicks the game hangs for all 9 seconds then suddenly the board is reprinted with both moves...
    How can I overcome this problem?
    Thank you

    first of all, take the time to read the documentation, at least the basics.
    secondly, never sleep in a GUI-component method, because then the GUI will not be updated until the sleep is over (just what you see).
    create a separate thread for sleeping and updating your board and let the GUI repaint as needed.
    thomas

  • Simulate doNothing(minutes) in JSP

    I am trying to simulate browser behaviour during extensive server processing. To do this I have a JSP which I pass a parameter of how long to sleep, so the JSP is still processing, but nothing is returned to the browser.
    What is the best way of doing this? At the moment I am using a loop that keeps using Calendar.getInstance(), but obviously this eats up my system resources.
    Suggestions with code really appreciated :)

    Thanks - this works perfectly.
    I didn't think of using Thread.sleep() because I didn't think it could be that simple.

Maybe you are looking for

  • Installing HP PSC 1350 all-in-one printer/scanner

    In the past, I could usually solve the "Offline" or "Not Connected" problems by unplugging my printer for a few minutes, but that no longer works. So, I decided to buy another one. However, just before clicking on the BUY button on Amazon, I decided

  • Cannot watch movie trailers

    I have only just gone wireless and now my trusted ATV has access to the internet! All good stuff, YouTube works fine, syncing all works fine but when I click on Movie Trailers I get a message saying 'Downloading trailers' with a spinning wheel which

  • Re: Bug: Cross Connection Query not working

    hello i am using vers. 4 and i cannot get BRIDGE to work i have posted more on this here BRIDGE command in Oracle SQL Developer - Stack Overflow i would be most grateful for any help

  • To configure Own Error page in Web Tier

    Hi, I am using jdev version 11.1.1.6. We have a error page for the application that we built which we can show to the User if the application pages comes up with an error. However if the Application itself is down.. We want to show the Users a error

  • OCI Error ORA-01403: no data found in oracle goldengate replication after tts instaniation

    I recently migrated our tg core system from sun solaris(11.1.0.7) to linux (11.2.0.3) environment using goldengate method (transportable tablespace method used for instantiation). The initial replication worked with HANDLECOLLISIONS and after I monit