JMeter +JSF 1.2 +Multiple threads issue

I have an issue when running JMeter with an JSF 1.2 application.
I have the regex and xpath fix working. It is extracting the correct ViewState value, but only as long as I am running one thread. If I start a thread group with multiple threads the regex/xpath will eventually return the default value and the test will fail.
Scenario 1 (SUCCESS):
I run one thread and one thread group, regex/xpath return the
"ViewState" value correctly and the test runs perfectly until I stop it.
Scenario 2 (FAILURE):
I run multiple threads and one thread group, regex/xpath
eventually return the DEFAULT value instead the "ViewState" value to
all but one thread. The more threads the faster they fail. It really
seems like there is a threading issue.
Has anyone experienced similar issues when running regex/xpath and multiple threads?

Thank you, I tried what you suggested and revealed something interesting. The application in some cases prints the following on the screen:
*~com.sun.faces.saveStateFieldMarker~*, and it is in those cases JMETER Xpath extraction fails.
Well I have to look more into it. Thank again for the help.

Similar Messages

  • Multiple threads issue

    here's the issue:
    if there was a Thread.waitFor() method I wouldn't have an issue.
    here's the situation:
    I have a method (M) that calls a thread (T). Inside T there is a JOptionPane (JOP) that is called inside a try-catch. After the call to M there is a while loop to check if T.isAlive() and sleep if it is, to prevent the main from continuing without waiting for T.
    here's the problem:
    When T hits the JOP the JVM hangs in the while loop after M. The only way to exit is to kill the JVM...
    Is there any way to have M wait to return with out calling another thread.sleep. It's basically a T.waitFor() but java doesn't have one...
    here's the psuedo code:
    main() {
    M();
    while (T.isAlive()) {
    Thread.sleep(1000);
    M () {
    T.start();
    T extends Thread {
    run() {
    try {
    something
    catch {
    JOP();
    </PRE>

    first off, the sleep() method has to be within a try...catch block. i think in the real program you did it like that though. i think you should try putting all the thread related stuff like the sleep() method into a synchronized block. if all that fails, dont let the thread sleep, but have it waiting, and give the other thread a reference to the calling thread. when the thread is finished simply call the notify() or notifyAll() method (Im not sure which one) on the first thread and itll continue. those calls have to be synchronized too, though. hope this helps

  • Multiple Thread of a xml publisher report - messed up fonts in the PDF out

    We are running 60000 invoices at a given time. In order to get the job done faster, the xml publisher report is set up to run mulitple threads. Each thread running unique set of invoices.
    I am seeing this issue, randomly.
    The pdf output of the invoice is having the fonts messed up. font 10 shows up as 14 and the invoice looks very bad.
    When i rerun the same set of invoices it looks absolutely normal.
    Also if I retrieve the xml output of the bad pdf and view it through the xmlpub desktop, it looks perfectly fine.
    Two times we saw this issue
    PRODUCTION
    - when i run 8 threads, i saw this issue in one of the thread and affected one invoice. (Production- 1 concurrent processing node+ 5 OPP processes and 5 threads + MEMORY is J:oracle.apps.fnd.cp.gsf.GSMServiceController:-mx3072m )
    TEST INSTANCE
    - when i ran with 16 threads, one of the thread running xml pub report affected all the invoices (UAT environment-1 concurrent processing node+ 7 OPP processes and 1 threads + MEMORY is J:oracle.apps.fnd.cp.gsf.GSMServiceController:-mx3072m )
    Looks like it is happening when running multiple threads.
    The formatting command or information is getting lost somewhere and the report is all messed up.
    Please advise.
    Thanks
    SJ

    Really appreciate your response. Can you pls give little more details.
    1] Are there any standard API's which I can use to submit XML publisher report from the JSP pages
    2]Is there any sample code snippet for any of the options that I can refer to..or pls let me know the API's, I will check on them
    Appreciate any help

  • Can multiple threads write to the database?

    I am a little confused from the statement in the documentation: "Berkeley DB Data Store does not support locking, and hence does not guarantee correct behavior if more than one thread of control is updating the database at a time."
    1. Can multiple threads write to the "Simple Data Store"?
    2. Considering the sample code below which writes to the DB using 5 threads - is there a possibility of data loss?
    3. If the code will cause data loss, will adding DB_INIT_LOCK and/or DB_INIT_TXN in DBENV->open make any difference?
    #include "stdafx.h"
    #include <stdio.h>
    #include <windows.h>
    #include <db.h>
    static DB *db = NULL;
    static DB_ENV *dbEnv = NULL;
    DWORD WINAPI th_write(LPVOID lpParam)
    DBT key, data;
    char key_buff[32], data_buff[32];
    DWORD i;
    printf("thread(%s) - start\n", lpParam);
    for (i = 0; i < 200; ++i)
    memset(&key, 0, sizeof(key));
    memset(&data, 0, sizeof(data));
    sprintf(key_buff, "K:%s", lpParam);
    sprintf(data_buff, "D:%s:%8d", lpParam, i);
    key.data = key_buff;
    key.size = strlen(key_buff);
    data.data = data_buff;
    data.size = strlen(data_buff);
    db->put(db, NULL, &key, &data, 0);
    Sleep(5);
    printf("thread(%s) - End\n", lpParam);
    return 0;
    int main()
    db_env_create(&dbEnv, 0);
    dbEnv->open(dbEnv, NULL, DB_CREATE | DB_INIT_MPOOL | DB_THREAD, 0);
    db_create(&db, dbEnv, 0);
    db->open(db, NULL, "test.db", NULL, DB_BTREE, DB_CREATE, 0);
    CreateThread(NULL, 0, th_write, "A", 0, 0);
    CreateThread(NULL, 0, th_write, "B", 0, 0);
    CreateThread(NULL, 0, th_write, "B", 0, 0);
    CreateThread(NULL, 0, th_write, "C", 0, 0);
    th_write("C");
    Sleep(2000);
    }

    Here some clarification about BDB Lock and Multi threads behavior
    Question 1. Can multiple threads write to the "Simple Data Store"?
    Answer 1.
    Please Refer to http://docs.oracle.com/cd/E17076_02/html/programmer_reference/intro_products.html
    A Data Store (DS) set up
    (so not using an environment or using one, but without any of the DB_INIT_LOCK, DB_INIT_TXN, DB_INIT_LOG environment regions related flags specified
    each corresponding to the appropriate subsystem, locking, transaction, logging)
    will not guard against data corruption due to accessing the same database page and overwriting the same records, corrupting the internal structure of the database etc.
    (note that in the case of the Btree, Hash and Recno access methods we lock at the database page level, only for the Queue access method we lock at record level)
    So,
    if You want to have multiple threads in the application writing concurrently or in parallel to the same database You need to use locking (and properly handle any potential deadlocks),
    otherwise You risk corrupting the data itself or the database (its internal structure).
    Of course , If You serialize at the application level the access to the database, so that no more one threads writes to the database at a time, there will be no need for locking.
    But obviously this is likely not the behavior You want.
    Hence, You need to use either a CDS (Concurrent Data Store) or TDS (Transactional Data Store) set up.
    See the table comparing the various set ups, here: http://docs.oracle.com/cd/E17076_02/html/programmer_reference/intro_products.html
    Berkeley DB Data Store
    The Berkeley DB Data Store product is an embeddable, high-performance data store. This product supports multiple concurrent threads of control, including multiple processes and multiple threads of control within a process. However, Berkeley DB Data Store does not support locking, and hence does not guarantee correct behavior if more than one thread of control is updating the database at a time. The Berkeley DB Data Store is intended for use in read-only applications or applications which can guarantee no more than one thread of control updates the database at a time.
    Berkeley DB Concurrent Data Store
    The Berkeley DB Concurrent Data Store product adds multiple-reader, single writer capabilities to the Berkeley DB Data Store product. This product provides built-in concurrency and locking feature. Berkeley DB Concurrent Data Store is intended for applications that need support for concurrent updates to a database that is largely used for reading.
    Berkeley DB Transactional Data Store
    The Berkeley DB Transactional Data Store product adds support for transactions and database recovery. Berkeley DB Transactional Data Store is intended for applications that require industrial-strength database services, including excellent performance under high-concurrency workloads of read and write operations, the ability to commit or roll back multiple changes to the database at a single instant, and the guarantee that in the event of a catastrophic system or hardware failure, all committed database changes are preserved.
    So, clearly DS is not a solution for this case, where multiple threads need to write simultaneously to the database.
    CDS (Concurrent Data Store) provides locking features, but only for multiple-reader/single-writer scenarios. You use CDS when you specify the DB_INIT_CDB flag when opening the BDB environment: http://docs.oracle.com/cd/E17076_02/html/api_reference/C/envopen.html#envopen_DB_INIT_CDB
    TDS (Transactional Data Store) provides locking features, adds complete ACID support for transactions and offers recoverability guarantees. You use TDS when you specify the DB_INIT_TXN and DB_INIT_LOG flags when opening the environment. To have locking support, you would need to also specify the DB_INIT_LOCK flag.
    Now, since the requirement is to have multiple writers (multi-threaded writes to the database),
    then TDS would be the way to go (CDS is useful only in single-writer scenarios, when there are no needs for recoverability).
    To Summarize
    The best way to have an understanding of what set up is needed, it is to answer the following questions:
    - What is the data access scenario? Is it multiple writer threads? Will the writers access the database simultaneously?
    - Are recoverability/data durability, atomicity of operations and data isolation important for the application? http://docs.oracle.com/cd/E17076_02/html/programmer_reference/transapp_why.html
    If the answers are yes, then TDS should be used, and the environment should be opened like this:
    dbEnv->open(dbEnv, ENV_HOME, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER | DB_THREAD, 0);
    (where ENV_HOME is the filesystem directory where the BDB environment will be created)
    Question 2. Considering the sample code below which writes to the DB using 5 threads - is there a possibility of data loss?
    Answer 2.
    Definitely yes, You can see data loss and/or data corruption.
    You can check the behavior of your testcase in the following way
    1. Run your testcase
    2.After the program exits
    run db_verify to verify the database (db_verify -o test.db).
    You will likely see db_verify complaining, unless the thread scheduler on Windows weirdly starts each thread one after the other,
    IOW no two or ore threads write to the database at the same time -- kind of serializing the writes
    Question 3. If the code will cause data loss, will adding DB_INIT_LOCK and/or DB_INIT_TXN in DBENV->open make any difference?
    Answer 3.
    In Your case the TDS should be used, and the environment should be opened like this:
    dbEnv->open(dbEnv, ENV_HOME, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER | DB_THREAD, 0);
    (where ENV_HOME is the filesystem directory where the BDB environment will be created)
    doing this You have proper deadlock handling in place and proper transaction usage
    so
    You are protected against potential data corruption/data loss.
    see http://docs.oracle.com/cd/E17076_02/html/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf
    Multi-threaded and Multi-process Applications
    DB is designed to support multi-threaded and multi-process applications, but their usage
    means you must pay careful attention to issues of concurrency. Transactions help your
    application's concurrency by providing various levels of isolation for your threads of control. In
    addition, DB provides mechanisms that allow you to detect and respond to deadlocks.
    Isolation means that database modifications made by one transaction will not normally be
    seen by readers from another transaction until the first commits its changes. Different threads
    use different transaction handles, so this mechanism is normally used to provide isolation
    between database operations performed by different threads.
    Note that DB supports different isolation levels. For example, you can configure your
    application to see uncommitted reads, which means that one transaction can see data that
    has been modified but not yet committed by another transaction. Doing this might mean
    your transaction reads data "dirtied" by another transaction, but which subsequently might
    change before that other transaction commits its changes. On the other hand, lowering your
    isolation requirements means that your application can experience improved throughput due
    to reduced lock contention.
    For more information on concurrency, on managing isolation levels, and on deadlock
    detection, see Concurrency (page 32).

  • How to proces the record in Table with multiple threads using Pl/Sql & Java

    I have a table containing millions of records in it; and numbers of records also keep on increasing because of a high speed process populating this table.
    I want to process this table using multiple threads of java. But the condition is that each records should process only once by any of the thread. And after processing I need to delete that record from the table.
    Here is what I am thinking. I will put the code to process the records in PL/SQL procedure and call it by multiple threads of Java to make the processing concurrent.
    Java Thread.1 }
    Java Thread.2 }
    .....................} -------------> PL/SQL Procedure to process and delete Records ------> <<<Table >>>
    Java Thread.n }
    But the problem is how can I restrict a record not to pick by another thread while processing(So it should not processed multiple times) ?
    I am very much familiar with PL/SQL code. Only issue I am facing is How to fetch/process/delete the record only once.
    I can change the structure of table to add any new column if needed.
    Thanks in advance.
    Edited by: abhisheak123 on Aug 2, 2009 11:29 PM

    Check if you can use the bucket logic in your PLSQL code..
    By bucket I mean if you can make multiple buckets of your data to be processed so that each bucket contains the different rows and then call the PLSQL process in parallel.
    Lets say there is a column create_date and processed_flag in your table.
    Your PLSQL code should take 2 parameters start_date and end_date.
    Now if you want to process data say between 01-Jan to 06-Jan, a wrapper program should first create 6 buckets each of one day and then call PLSQL proc in parallel for these 6 different buckets.
    Regards
    Arun

  • Is there any problem to use multiple threads to send email with JavaMail

    Dear all,
    I am using JavaMail 1.3.2 to send emails with SMTP, it works very well for a long time.
    But one day, I found that the email service hanged and I could never send email again until I restart the tomcat. I found that the reason was a deadlock had been created, the required resource for sending email had not been released.
    I guess the error is due to multiple threads are sending email at the same time. I made a test to create seperate thread for sending each email. After few days, I found this deadlock happened again. So, my question is: Can I use JavaMail with multiple threads? If not, I may need to sychronized all the thread that using JavaMail. I would like to make sure this is the reason for causing the deadlock problem.
    Here is part of my code for using JavaMail:
    transport = session.getTransport("smtp");
    transport.connect(email_host, smtp_user, smtp_pass);
    message.saveChanges();
    transport.sendMessage(message,message.getAllRecipients());
    which is very standard call, and it worked well for a long time.
    Here is part for my thread dump on tomcat:
    (Thread-339)
    - waiting to lock <0x5447c180> (a sun.nio.cs.StandardCharsets)
    (Thread-342)
    - locked <0x5447c180> (a sun.nio.cs.StandardCharsets)
    It seems that these happened after call the method transport.sendMessage() or message.updateChanges()
    , and the underlying implementation may require the JRE StandardCharsets object. But the object had been locked and never be released. So, the sendMessage() or updateChanges() can't be completed.
    Please give me some helps if you have any idea about it.
    Thanks very much!
    Sirius

    Note that the Nightly build gets updated daily (and sometimes more than once in case of a respin) and it is always possible that something goes wrong and it doesn't work properly, so be prepared for issues if you decide to stay with the Nightly build and make sure to have the current release with its own profile installed as well in case of problems.
    See also:
    * http://kb.mozillazine.org/Testing_pre-release_versions
    *http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
    *http://kb.mozillazine.org/Shortcut_to_a_specific_profile
    *http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

  • Thread issue in jsp.....

    I understand that the j2ee container (tomcat or jrun...) creates ONE instance of the jsp page (i.e. compiled into servlet class) when the jsp page (let's say, myPage.jsp) is accessed the first time. All request for this jsp page will be done through thread.
    My questions are:
    1. If I instantiate an object (say, myObject) within the scriptlet, will the container create one instance of this object for each "jsp" thread? Or will there be only one instance of the myObject object and each "jsp" thread be running on a thread of myObject?!
    2. If I use javaBean in my jsp (i.e. use the <jsp:useBean..../> tag), I know that the container will create a new instance of the bean class. So if there are multiple request on the same jsp page, is it true that many instances of the bean will be created? And there will be no thread issue involed?!!
    Thanks!!

    When you create an instance of an object inside a scriplet using <% ... %>, that instance is local to the service) method of the servlet corresponding to the JSP. So there is no threading related issue.
    Smilar is the argument why there is not threading related issue with using <jsp:useBean>

  • Parallel function call and thread issue

    Sorry to post one issue here which is related to code. i was debugging a code which was wrote long time back by one developer. the issue is two function is called parallel using thread and one function set a variable true at end and another function just
    looping until the variable is set to true. the variable value is not getting set to true. here i am posting a code snippet and just tell me what is mistake in the code for which variable is not getting set to true by first function.
    when user click button then two function is invoked
    private void UPDATE_Click(object sender, System.EventArgs e)
    SavedFirst();
    AddCheckThread();
    public void SavedFirst()
    IsOpen = true;
    System.Threading.Thread loadT = new System.Threading.Thread(new System.Threading.ThreadStart(SaveAll));
    loadT.Start();
    IsOpen = false;
    private void AddCheckThread()
    if (!ALLFlag)
    loadingThread = new System.Threading.Thread(new System.Threading.ThreadStart(addCheck));
    loadingThread.Priority = System.Threading.ThreadPriority.Lowest;
    loadingThread.Start();
    private void SaveAll()
    if (this.InvokeRequired)
    this.Invoke(new MethodInvoker(delegate
    ALLFlag = false;
    if (!ALLFlag)
    loadingThread = new System.Threading.Thread(new System.Threading.ThreadStart(AddProducts));
    loadingThread.Priority = System.Threading.ThreadPriority.Lowest;
    loadingThread.Start();
    return;
    private void AddProducts()
    if (this.InvokeRequired)
    this.Invoke(new MethodInvoker(delegate
    ALLFlag = false;
    if (System.Windows.Forms.MessageBox.Show(this, "Would you like to add the details into the Database?", "Add?", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
    if (comboOUR.SelectedItem == null || comboCountry.SelectedItem == null || comboSelleble.SelectedItem == null || txtOereff.Text == "" || txtUKPrice.Text == "" || txtUSPrice.Text == "" || txtSUrCharge.Text == "" || txtOURUS.Text == "" || txtOURUK.Text == "")
    FormValidation();
    else
    Gather_Data();
    bool isInserted = false;
    if (System.Windows.Forms.MessageBox.Show(this, "Would you like to add the details into \"Detailed-Product\" Too?", "Add?", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
    isInserted = bbaProduct.BBASaveProduct();
    if (isInserted == true)
    isInserted = false;
    isInserted = bbaProduct.InsertInProductTable(BBAProduct.DetailProductID);
    if (isInserted == true)
    System.Windows.Forms.MessageBox.Show(this, "Product Successfully Added ", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Error Occurred !! Not Added Into the Database ", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Error Occurred !! Not Added Into the Database ", "Add");
    else
    isInserted = bbaProduct.InsertInProductTable(0);
    if (isInserted == true)
    System.Windows.Forms.MessageBox.Show(this, "Successfully Inserted Into the database", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Error Occurred !! Not Added Into the Database", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Process Cancelled By The User", "Add");
    ALLFlag = true;
    return;
    #region Add Check
    private void addCheck()
    if (this.InvokeRequired)
    this.Invoke(new MethodInvoker(delegate
    this.Opacity = 0.8;
    axShockwaveFlash1.Visible = true;
    axShockwaveFlash1.Play();
    while (!ALLFlag)
    int x = 0;
    axShockwaveFlash1.Visible = false;
    axShockwaveFlash1.Visible = false;
    axShockwaveFlash1.StopPlay();
    this.Opacity = 1;
    ALLFlag = false;
    loadingThread.Abort();
    return;
    help me to locate where is the mistake for which ALLFlag value is not getting set to true. thanks

    Your reliance on a field value across threads isn't going to work reliably.  In a multi-core/multi-threaded world the memory model allows for reading data out of order for optimization reasons.  Additionally the CPU can and will cache recently
    used data in memory that isn't shared across processors.  This can get you into trouble as you will not be reading the same value across processors.
    The only correct way to ensure that multiple threads access the same data correctly is to use sync objects that are designed for that such as a Semaphore or Mutex.  Sync objects allow you to safely share data across threads.
    Overall your code appears to be trying to update the UI using a thread but since it is calling Invoke each time you are basically spawning a thread that then blocks waiting for the UI thread.  You could pretty much eliminate your issues by getting rid
    of the threading calls altogether along with any sort of state management variables that were arbitrarily created (ALLflags) and simply use BeginInvoke.  You didn't post who was calling your higher level save methods but if it is a UI element then BeginInvoke
    and InvokeRequired are completely redundant as is all the threading.
    You can cleanly update this code to eliminate all the extra variables and threading and simply use the newer async/await functionality to help resolve the issues your code is having.  But you still have problems with the invoked code.  In one of
    the methods you are looping while waiting for a variable to be set.  But since you invoked it then it is occurring on the UI thread.  Because it is on the UI thread and that can only do 1 thing at a time, if ALLflag is false your code will deadlock. 
    The only other code that would set it to true cannot run because it is also invoked on the UI thread and only one of them can run at any one time.  Basically each of your threads are going to try to run on the same thread and only 1 of them will be able
    to.  Until the first thread method finishes the second one will never run.
    If you need Boolean flags then consider using a ManualResetEvent instead.  It is thread safe, works across threads and doesn't have any of the problems of a Boolean field when talking about threading. But you still have a deadlock between your invoked
    code that nothing will solve except rewriting your code.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Multiple Threads writing to the same stream and "Write End Dead"

    Hi, I'm wondering what is the proper method for having multiple threads write to the same stream.
    Right now I have PipedWriter that I give to several Threads.
    However the JLS specifies that when the thread writing to PipedWriter dies, an exception will be generated. Does it mean that I may get a "write end dead" exception when any of the threads dies?
    More specifically I'm trying to extract keywords from a set of pages and print out keywords with their contexts (using threads to avoid a single blocked pages from blocking entire process)

    Your topic says "stream" but your post says "writer" - there's a difference. Readers/writers use the native encoding (which is correct if, for example, you're reading .DOC files created in Windows) while streams use UTF-8 encoding (which is correct if you've got one java app talking to another).
    Multiple threads can output to the same source. You've probably seen really annoying examples as your own System.out.println()s get intermixed with other JVM output in the JVM's window. Synchronization is going to be a serious issue.
    As to the exception, why not just catch it and ignore it?

  • Multiple Threads Using System.out.println...

    i have a client server app and each client that connects to the server has its own thread.
    i am running the server on a pc using windows xp and to run it i just use a bat file which uses cmd.exe and my output using System.out.println prints out in the cmd.exe.
    each of my threads is using System.out.println to send debug info and outs quite often.
    after the screen fills a scroll bar appears at the right and you can scroll back to see past output.
    my app is all running ok but when i had a ton of output coming in all at once i tried to scroll back to see the older output and realized that if i click down on the scroll bar and fight the new input it freezes my server app. then when i release it it continues lol.
    it made me wonder if output from multiple threads when there are many all at once (say 20 or 30 threads all outputing at the exact same time) could cause a slow down or effect the performance of the server?
    i use a debug variable so i can just turn this output 100 % off except for critical errors so there would be no output but i am just curious as to whether or not it may be causing problems when its on.

    That's not a performance issue, I guess System.out.println() simply gets blocked by the console while you're scrolling and thus your app stalls, until you stop doing that.
    Maybe you should look into logging.

  • DBXML 2.4.16:  Accessing containers from multiple threads and deadlock

    Hi,
    I am evaluating dbxml for my upcoming project (http://xcapserver.sourceforge.net) where I am sending following four requests through multiples threads which gets into deadlock situation after running certain iterations. Can you please help me what am I doing wrong?
    1. Put Document
    2. Get Document
    3. Get Document Node (XPATH Query)
    4. Delete Document
    I am using following environment variables.
    u_int32_t env_flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |DB_INIT_TXN | DB_THREAD|DB_RECOVER| DB_AUTO_COMMIT; (I tried removing DB_AUTO_COMMIT)
    dbEnv_.open(dbxml_env.c_str(), env_flags, 0);
    XmlManager instance is initialized as :pxmlmgr_= new XmlManager(&dbEnv_) ;
    pxmlmgr_->setDefaultContainerType(DbXml::XmlContainer::WholedocContainer);
    NOTE: pxmlmgr_ instance is member variable of singleton class assuming XmlManager is thread safe and can be reused for all threads.
    Below is the psudo code. It is written in C++. I have removed exception handling and other code for clarity.
    getDocument (...){
    XmlTransaction containerTxn =pxmlmgr_->createTransaction();
              XmlContainer cont = pxmlmgr_->openContainer(container, DB_RDONLY|DB_THREAD);
              XmlDocument doc = cont.getDocument(document);
              containerTxn.commit();
              data = doc.getContent(data
    NOTE: To use doc(...) function, I have to create an alias than only I can use container name e.g /dbxml/resource-lists/users/rjoshi where /dbxml is env_home.
    container name: /dbxml/resource-lists/users/rjoshi (here rjoshi is container name)
    document name: presence
    getDocumentNode(...) {
    size_t npos = container.find_last_of("/", container.length());
              std::string alias = container.substr(npos+1, container.length()-npos) + "_" + document;
                   XCAP_DEBUG("Alias:" + alias);
                   std::string fullQuery = "doc('dbxml:" + alias + '/' + document + "')" + node;
                   XCAP_DEBUG("XPath Full Query:" + fullQuery);
                   XmlTransaction txn = pxmlmgr_->createTransaction();
                   XmlContainer cont = pxmlmgr_->openContainer(container, DB_RDONLY|DB_THREAD);
                   cont.addAlias(alias);
                   //query context
                   XmlQueryContext context = pxmlmgr_->createQueryContext();
              XmlResults results(pxmlmgr_->query(fullQuery, context ) );
                   cont.removeAlias(alias);
                   txn.commit();
    putDocument(....){
    size_t npos = container.find_last_of("/", container.length());
              std::string dir = container.substr(0, npos);
                   boost::filesystem::path p(dir);
                   if(!boost::filesystem::exists(p)) {
                        boost::filesystem::create_directories(p);
                   XmlTransaction txn = pxmlmgr_->createTransaction();
                   XmlContainer cont = pxmlmgr_->openContainer(container, DBXML_TRANSACTIONAL|DB_THREAD|DB_CREATE);
              XmlUpdateContext updateContext = pxmlmgr_->createUpdateContext();
                   cont.putDocument(document, data, updateContext, 0);
                   txn.commit();
    deleteDocument() {
    XmlTransaction txn = pxmlmgr_->createTransaction();
              XmlContainer cont = pxmlmgr_->openContainer(container, DB_THREAD);
              XmlUpdateContext updateContext = pxmlmgr_->createUpdateContext();
              cont.deleteDocument(document, updateContext);          
              txn.commit();
    }

    1. What platform are you on?
    rjoshi>>I am running on mac OSX 10.5.8
    2. There are still some potential coding issues here:
    2a. In DbXmlDb.hpp there is a DbEnv instance which is
    a member of your class. If using DbEnv as a data member
    it is usually best to use new/delete vs making it a member.
    rjoshi>>I have modified code to use new/delete
    2b. In DbXmlDB.cpp DBXML_ADOPT_DBENV is being used.
    DBXML_ADOPT_DBENV requires that DbEnv be created via
    new() as it calls delete() on it.
    rjoshi>> modified code to use new/delete
    2c. In general is it best not to open containers upon
    each use. Containers should be opened and shared among
    threads.
    rjoshi>> In real application, multiple devices (e.g IM, Phone) can read/write same document but it's not always the case so I don't want to open the container and keep in the memory. There is no way for me to know when to close the container. Is there any way to set flag where container can be open for certain duration and if not used, it will get closed and removed from memory?
    2d. Instead of using a transaction for opening containers
    use DBXML_TRANSACTIONAL|DB_THREAD. Also the use of
    DB_RDONLY in the read cases will not change anything significant
    as open instances are shared and the state of the first
    one is the only one that counts.
    rjoshi>> In init() function, I am setting default container flags as
    pxmlmgr_->setDefaultContainerFlags(DB_CREATE | DB_THREAD
                   | DBXML_TRANSACTIONAL);
    Do I still need to set these flags while opening the container?
    2e. The setting of DB_THREAD looks to be used inconsistently.
    It should be used all the time if the application is
    making use of threading.
    rjoshi>> Again I was setting default flag for container as below in the init() function so was not using it. I have corrected the inconsistency.
    pxmlmgr_->setDefaultContainerFlags(DB_CREATE | DB_THREAD
                   | DBXML_TRANSACTIONAL);
    2f. I can not tell for sure from looking at the cpp file,but
    just make sure that operation-based transactions are consistently
    passed in the application.
    rjoshi>> I have removed transactions while opening the container and using all other places.
    Still I am able to reproduce the deadlock. Please see the below output of db_state -CA.
    bash-3.2$ ./db_stat -h /dbxml/ENV -CA
    Default locking region information:
    3327     Last allocated locker ID
    0x7fffffff     Current maximum unused locker ID
    9     Number of lock modes
    1000     Maximum number of locks possible
    1000     Maximum number of lockers possible
    1000     Maximum number of lock objects possible
    39     Number of current locks
    143     Maximum number of locks at any one time
    75     Number of current lockers
    313     Maximum number of lockers at any one time
    12     Number of current lock objects
    26     Maximum number of lock objects at any one time
    6643     Total number of locks requested
    6560     Total number of locks released
    0     Total number of locks upgraded
    2166     Total number of locks downgraded
    531     Lock requests not available due to conflicts, for which we waited
    9     Lock requests not available due to conflicts, for which we did not wait
    0     Number of deadlocks
    0     Lock timeout value
    0     Number of locks that have timed out
    0     Transaction timeout value
    0     Number of transactions that have timed out
    464KB     The size of the lock region
    60     The number of region locks that required waiting (0%)
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock REGINFO information:
    Lock     Region type
    7     Region ID
    /dbxml/ENV/__db.007     Region name
    0xf000     Original region address
    0xf000     Region address
    0xf044     Region primary address
    0     Region maximum allocation
    0     Region allocated
    Region allocations: 3005 allocations, 0 failures, 0 frees, 1 longest
    REGION_JOIN_OK     Region flags
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock region parameters:
    786457     Lock region region mutex [60/23741 0% 12394/0]
    1031     locker table size
    1031     object table size
    436     obj_off
    45860     locker_off
    1     need_dd
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock conflict matrix:
    0     0     0     0     0     0     0     0     0     
    0     0     1     0     1     0     1     0     1     
    0     1     1     1     1     1     1     1     1     
    0     0     0     0     0     0     0     0     0     
    0     1     1     0     0     0     0     1     1     
    0     0     1     0     0     0     0     0     1     
    0     1     1     0     0     0     0     1     1     
    0     0     1     0     1     0     1     0     0     
    0     1     1     0     1     1     1     0     1     
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Locks grouped by lockers:
    Locker Mode Count Status ----------------- Object ---------------
    c3e dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c3e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    c41 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c42 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c42 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    c45 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c46 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c46 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    c49 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c4a dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c4a READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    c4d dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c4e dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c4e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    c51 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c52 dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    c52 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    c52 READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c55 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c59 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c59 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    c5c dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c5d dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    c5d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16
    c5d READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c60 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000325 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000326 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    80000326 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    80000326 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    80000327 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c8e dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    80000328 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    80000328 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    80000328 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032a dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c91 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032b dd= 0 locks held 3 write locks 1 pid/thread 12389/0
    8000032b WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    8000032b READ 7 HELD /dbxml/resource-lists/users/rjoshi page 13
    8000032b WRITE 14 HELD /dbxml/resource-lists/users/rjoshi page 13
    8000032b READ 3 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032c dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032c READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c93 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032d dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c94 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032e dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032e READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c95 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032f dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000330 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000330 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000331 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000332 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000332 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c99 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c99 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    80000333 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000333 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000334 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000334 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000335 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c9c dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000336 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000336 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c9d dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c9d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    ca0 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ca1 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    ca1 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    ca4 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ca5 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    ca5 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    ca8 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ca9 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    ca9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    cac dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cad dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    cad READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    cad READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cb0 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cb4 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    cb4 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    cb7 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cb8 dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    cb8 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16
    cb8 READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cbb dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ce9 dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cec dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ced dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cee dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cef dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf0 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf1 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf2 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf3 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf4 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf5 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf6 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf7 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf8 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf9 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfa dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfb dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfc dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfd dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfe dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cff dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Locks grouped by object:
    Locker Mode Count Status ----------------- Object ---------------
    80000326 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    80000328 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032b READ 3 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032b WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    8000032c READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    8000032e READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000330 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000332 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000333 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000334 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000336 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c4e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    ca9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    c4a READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    ca5 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    c59 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    cb4 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    8000032b WRITE 14 HELD /dbxml/resource-lists/users/rjoshi page 13
    8000032b READ 7 HELD /dbxml/resource-lists/users/rjoshi page 13
    80000328 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    80000326 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    c52 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    cad READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    c3e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    c99 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    c52 READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c5d READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cad READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cb8 READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c46 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    ca1 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    c42 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    c9d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    c5d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16
    cb8 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16

  • How to protect the creation of a db across multiple threads/processes?

    Given a multi-process, multi-threaded application, and one database file to be created, how can I guarantee that only one of the threads in one of the processes successfully creates the database, when ALL of the threads are going to either attempt to create it, or open it (if it already exists) upon startup?
    My current logic for all threads is:
    set open flags to DB_THREAD
    start transaction
    attempt to open the db
    if ENOENT
    abort transaction
    change open flags to DB_CREATE | DB_EXCL | DB_THREAD
    retry
    else if EEXIST
    abort transaction
    change open flags to DB_THREAD
    retry
    else if !ok
    # some other error
    end
    commit transaction
    I'm testing on Linux right now, with plans to move to Windows, AIX, and Solaris. What I'm experiencing on Linux is several of the threads (out of 10 threads I'm testing) will succeed in creating the database. The others will receive either either succeed in opening the first time through, or will receive the EEXIST when they do the open w/ create flags - ultimately, they open the same created db (I'm presuming the last one that's created by one of the other threads). Effectively, the open with DB_CREATE | DB_EXCL is not ensuring that only one DB is created. I was under the impression that opening in a transaction would guarantee this, but it does not, or maybe I'm doing something incorrectly?
    Should DB_CREATE | DB_EXCL and opening in a transaction guarantee that only one thread can create the database? Do I need to use another synchronization method?
    Note: I am running off of a local disk, not over NFS or anything like that.
    I tried taking out my transaction and using DB_AUTO_COMMIT instead, still no go - multiple threads still report they successfully created the DB. Using BDB 4.5.
    Thanks,
    Kevin Burge

    Brian,
    Thanks for the reply. I think I'm doing what you said, unless I'm misunderstanding. I do have all threads try to do the DB_CREATE | DB_EXCL. Are you saying I shouldn't use the DB_EXCL flag?
    The problem I was seeing with 10 threads calling open w/ DB_CREATE | DB_EXCL on the same db:
    * Between 1 and 9 threads would return success from db->open with the creation flags.... but the last one to create "wins".
    * All the other threads would get EEXIST, as expected.
    The threads that "lost", do get a successful return code from "open" with the create flags, but all data written to them is lost. They act normally except for the fact that the have a deleted file-handle that they are writing to. There's no indicator that records written to them are going into the void.
    My test:
    I had 10 threads each trying to create or open a recno db, then append 10 records, for a total of 100 records expected. Ultimately, I would end up with between 20 to 100 records in the db, depending on how many of the threads said they successfully created the db. So, if 5 threads said they created the db successfully, then 40 records would be missing, because 4 of those threads were writing to deleted file handles. If 2 threads said they created the db, then 10 records would be missing....If 8 threads, then 70 records missing, etc.
    In other words, multiple threads creating the db appears to work correctly, because there are no errors. It was the missing records that caught my attention, and prompted my question on this forum.
    For what it's worth, I've worked around the problem by opening a similarly named file via the open() system call, with O_CREAT|O_EXCL, which is guaranteed to be atomic. The first thread that can create this temp file is the only thread that can actually create the db - all others sleep upon open with ENOENT until it's created.
    Thanks,
    Kevin

  • PrinterException when multiple threads try to print report using JRC

    Iam using Crystal Report's JRC for printing reports, it works fine.
    But the problem araises when i use multiple threads.
    I used the following:
    reportClientDocument.getPrinterOutputController().printReport(.....); to print.
    I get the following exception
    Caused by: java.awt.print.PrinterException: No printer named "\\ch03\printer05" could be found.
    Without multiple thread it works fine.
    I have been scratching my head for days on this problem, any help is very much appreciated..

    If an API doesn't specifically say that it is thread safe then it isn't likely to be thread safe and the only way to approach it is to assume that it isn't.

  • How do i use multiple threads( very much real time), using JavaFX?

    I'm creating an application, using JavaFX because one can create awesome GUI using JavaFX. I need to know how to create real time multiple threads using javafx.
    JavaFX doesn't support creation of multiple threads, but i think there is another way of doing it. I need it work in real time as my application works with an hardware (wacom intous 3 tablet), and i need mutiple threads to get all the parameters from the stylus of the tablet simultaneously...
    any code which will help me out or explaination on how to go about this is appreciated...
    Help required quickly...

    See example at
    [http://jfxstudio.wordpress.com/2009/06/09/asynchronous-operations-in-javafx/|http://jfxstudio.wordpress.com/2009/06/09/asynchronous-operations-in-javafx/]

  • Problem with multiple threads accessing the same Image

    I'm trying to draw into one Image from multiple threads. It works fine for a while, but then suddenly, the image stops updating. Threads are still running but the image won't update. I'm using doublebuffering and threads are simply drawing counters into Image with different speed.
    It seems like the Image gets deadlocked or something. Anyone have any idea what's behind this behavior or perhaps better solution to do such thing.
    Any help will be appreciated.

    Sorry Kglad, I didn't mean to be rude. With "No coding
    errors" I meant the animation itself runs with no errors. I'm sure
    you could run the 20 instances with no freezing (that's why I put
    the post :) ) But I'm affraid it is an animation for a client, so I
    cannot distribute the code.
    Perhaps I didnt explain the situation clearly enough (in part
    because of my poor english...).-
    - By 20 instances I mean 20 separated embedded objects in the
    html
    - The animation is relatively simple. A turned on candle, in
    each cycle I calculate the next position of the flame (that
    oscilates from left to right). The flame is composed by 4
    concentric gradients. There is NO loops, only an 'onEnterFrame'
    function refreshing the flame each time.
    - It's true that I got plenty variables at the _root level.
    If that could be the problem, how can I workaround it?
    - It is my first time trying to embed so many objects at the
    same time too. No idea if the problem could be the way I embed the
    object from the html :(
    - The only thing I can guess is that when a cycle of one of
    the object is running, the other 19 objects must wait their turn.
    That would explain why the more instances I run, the worst results
    I get. In that case, I wonder if there's a way to run them in a
    kind of asynchronous mode, just guessing...
    Any other comment would be appreciated. Anyway, thanks a lot
    everybody for your colaboration.

Maybe you are looking for

  • Could someone help me figure out why after saving a form some subforms are hidden again

    I am asking this on behalf of a coworker.  We have a form she is working on with a drop down (ddlDropDown) with 1, 2, and 3 listed (same values,,1,2,3)  That trigger hidden subforms to appear (Employee1, Employee2, Employee3).  Initially, Employee1 i

  • MM-Based inventory management & Replenishment -based Inventory Management

    Hi, Can any one through me some light on the difference between "MM-Based inventory management" & "Replenishment -based Inventory Management" in IS-Retail. Is it something related to planning, If so what is the difference. Thanks in Advance, Shakthi

  • Enabling disabling LOV in adf :query panel

    I have a requirement where i have 3 drop downs which are dependent LOV's .These drop downs are binded as bind variable parameters for search through view criteria. The first drop down needs to be enabled by default and rest will be enabled only when

  • Configuring CRM business Package - 4.0 60.2.3 and ISA on EP6SP11

    Hi all, We have installed CRM business Package - 4.0 60.2.3 on EP6 SP11. For which we have created SAP_CRM system, filled in the all required parameters like application host, gateway service, client no, user authentication type etc.( Not ISA related

  • Unsupported Content-Type: text/plain

    Hi everyone, I am trying to invoke an aync Oracle BPEL process from WLI 8.1.6, without worrying about the response / callback. The web service control that is generated shows the operation stub as public void receive (java.lang.String input); which m