AUTH_CHECK_MISMATCH and LANGUAGE_MISMATCH

Hi all
I have identified that same sql_id has 4 child_number in v$sql, in order to find out what is the reason of execution changes I looked into v$sql_shared_cursor with sql_id and I saw
AUTH_CHECK_MISMATCH=Y and LANGUAGE_MISMATCH=Y for 4 child sql ;
1-why value=y for all childs ? doesnt have to someone has value=N ?
2-What is the exact mean of these mismatchs give me some example ? when these mismatchs happens ?
3-V$Sql_Shared_Cursor is the best view to find child number changes or execution changes ?
Best Regards
10.2.2
Edited by: EB on Feb 5, 2009 5:36 PM

EB wrote:
I have identified that same sql_id has 4 child_number in v$sql, in order to find out what is the reason of execution changes I looked into v$sql_shared_cursor with sql_id and I saw
AUTH_CHECK_MISMATCH=Y and LANGUAGE_MISMATCH=Y for 4 child sql ;
2-What is the exact mean of these mismatchs give me some example ? when these mismatchs happens ?The AUTH_CHECK_MISMATCH is usually indicating that a VPD/RLS policy is active and therefore the SQL is actually unique and not sharable, although not visible in V$SQL.
See e.g. AskTom for an example: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:62048567543425#673597500346350876
The LANGUAGE_MISMATCH indicates that different NLS related settings, e.g. different NLS_SORT or NLS_COMP settings were used that influence the meaning/sort output/filter predicates and therefore are not sharable.
You can try it yourself by simply executing a query like "SELECT * FROM <TABLE> ORDER BY <VARCHAR_COL>" twice, the first time using a binary sort order ("ALTER SESSION SET NLS_SORT = binary"), the second time using a different sort order like "ALTER SESSION SET NLS_SORT = german". Then you'll find two child cursors for this statement.
A quick test with 10g XE though revealed that a different NLS_SORT setting already showed a 'Y' in both the AUTH_CHECK_MISMATCH and LANGUAGE_MISMATCH columns, although I'm not sure why the AUTH_CHECK_MISMATCH column shows 'Y' in this particular case.
So may be you simply have sessions that use different NLS settings which could already be caused by different NLS client settings.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/

Similar Messages

  • AUTH_CHECK_MISMATCH BIND_MISMATCH LANGUAGE_MISMATCH

    when I run SQL (further below) I get significant number of results of AUTH_CHECK_MISMATCH LANGUAGE_MISMATCH
    Just wondering if APEX 4.1.1 has not installed correctly?
    eg1 -AUTH_CHECK_MISMATCH BIND_MISMATCH LANGUAGE_MISMATCH
    SELECT SHORTCUT_NAME, ID FROM WWV_FLOW_SHORTCUTS WHERE FLOW_ID = :B3 AND (BUILD_OPTION IS NULL OR (BUILD_OPTION > 0 AND (:B2 IS NULL OR INSTR(:B2 ,':'||BUILD_OPTION||':') = 0) ) OR (BUILD_OPTION < 0 AND (:B1 IS NOT NULL AND INSTR(:B1 ,':'||(0-BUILD_OPTION)||':') = 0) ) ) ORDER BY SHORTCUT_NAMEeg2 - AUTH_CHECK_MISMATCH LANGUAGE_MISMATCH
    SELECT ROWID FROM WWV_FLOW_DATA WHERE FLOW_INSTANCE = :B3 AND ITEM_ID = :B2 AND ITEM_NAME = :B1 FOR UPDATE NOWAIT"
    select version_count,reason,sql_text from (
    select
    address,''
    ||decode(max(                UNBOUND_CURSOR),'Y',               ' UNBOUND_CURSOR')
    ||decode(max(             SQL_TYPE_MISMATCH),'Y',            ' SQL_TYPE_MISMATCH')
    ||decode(max(            OPTIMIZER_MISMATCH),'Y',           ' OPTIMIZER_MISMATCH')
    ||decode(max(              OUTLINE_MISMATCH),'Y',             ' OUTLINE_MISMATCH')
    ||decode(max(            STATS_ROW_MISMATCH),'Y',           ' STATS_ROW_MISMATCH')
    ||decode(max(              LITERAL_MISMATCH),'Y',             ' LITERAL_MISMATCH')
    ||decode(max(           EXPLAIN_PLAN_CURSOR),'Y',          ' EXPLAIN_PLAN_CURSOR')
    ||decode(max(         BUFFERED_DML_MISMATCH),'Y',        ' BUFFERED_DML_MISMATCH')
    ||decode(max(             PDML_ENV_MISMATCH),'Y',            ' PDML_ENV_MISMATCH')
    ||decode(max(           INST_DRTLD_MISMATCH),'Y',          ' INST_DRTLD_MISMATCH')
    ||decode(max(             SLAVE_QC_MISMATCH),'Y',            ' SLAVE_QC_MISMATCH')
    ||decode(max(            TYPECHECK_MISMATCH),'Y',           ' TYPECHECK_MISMATCH')
    ||decode(max(           AUTH_CHECK_MISMATCH),'Y',          ' AUTH_CHECK_MISMATCH')
    ||decode(max(                 BIND_MISMATCH),'Y',                ' BIND_MISMATCH')
    ||decode(max(             DESCRIBE_MISMATCH),'Y',            ' DESCRIBE_MISMATCH')
    ||decode(max(             LANGUAGE_MISMATCH),'Y',            ' LANGUAGE_MISMATCH')
    ||decode(max(          TRANSLATION_MISMATCH),'Y',         ' TRANSLATION_MISMATCH')
    ||decode(max(                  INSUFF_PRIVS),'Y',                 ' INSUFF_PRIVS')
    ||decode(max(              INSUFF_PRIVS_REM),'Y',             ' INSUFF_PRIVS_REM')
    ||decode(max(         REMOTE_TRANS_MISMATCH),'Y',        ' REMOTE_TRANS_MISMATCH')
    ||decode(max(     LOGMINER_SESSION_MISMATCH),'Y',    ' LOGMINER_SESSION_MISMATCH')
    ||decode(max(          INCOMP_LTRL_MISMATCH),'Y',         ' INCOMP_LTRL_MISMATCH')
    ||decode(max(         OVERLAP_TIME_MISMATCH),'Y',        ' OVERLAP_TIME_MISMATCH')
    ||decode(max(         MV_QUERY_GEN_MISMATCH),'Y',        ' MV_QUERY_GEN_MISMATCH')
    ||decode(max(       USER_BIND_PEEK_MISMATCH),'Y',      ' USER_BIND_PEEK_MISMATCH')
    ||decode(max(           TYPCHK_DEP_MISMATCH),'Y',          ' TYPCHK_DEP_MISMATCH')
    ||decode(max(           NO_TRIGGER_MISMATCH),'Y',          ' NO_TRIGGER_MISMATCH')
    ||decode(max(              FLASHBACK_CURSOR),'Y',             ' FLASHBACK_CURSOR')
    ||decode(max(        ANYDATA_TRANSFORMATION),'Y',       ' ANYDATA_TRANSFORMATION')
    ||decode(max(          TOP_LEVEL_RPI_CURSOR),'Y',         ' TOP_LEVEL_RPI_CURSOR')
    ||decode(max(         DIFFERENT_LONG_LENGTH),'Y',        ' DIFFERENT_LONG_LENGTH')
    ||decode(max(         LOGICAL_STANDBY_APPLY),'Y',        ' LOGICAL_STANDBY_APPLY')
    ||decode(max(                DIFF_CALL_DURN),'Y',               ' DIFF_CALL_DURN')
    ||decode(max(                BIND_UACS_DIFF),'Y',               ' BIND_UACS_DIFF')
    ||decode(max(        PLSQL_CMP_SWITCHS_DIFF),'Y',       ' PLSQL_CMP_SWITCHS_DIFF')
    ||decode(max(         CURSOR_PARTS_MISMATCH),'Y',        ' CURSOR_PARTS_MISMATCH')
    ||decode(max(           STB_OBJECT_MISMATCH),'Y',          ' STB_OBJECT_MISMATCH')
    ||decode(max(             PQ_SLAVE_MISMATCH),'Y',            ' PQ_SLAVE_MISMATCH')
    ||decode(max(        TOP_LEVEL_DDL_MISMATCH),'Y',       ' TOP_LEVEL_DDL_MISMATCH')
    ||decode(max(             MULTI_PX_MISMATCH),'Y',            ' MULTI_PX_MISMATCH')
    ||decode(max(       BIND_PEEKED_PQ_MISMATCH),'Y',      ' BIND_PEEKED_PQ_MISMATCH')
    ||decode(max(           MV_REWRITE_MISMATCH),'Y',          ' MV_REWRITE_MISMATCH')
    ||decode(max(         ROLL_INVALID_MISMATCH),'Y',        ' ROLL_INVALID_MISMATCH')
    ||decode(max(       OPTIMIZER_MODE_MISMATCH),'Y',      ' OPTIMIZER_MODE_MISMATCH')
    ||decode(max(                   PX_MISMATCH),'Y',                  ' PX_MISMATCH')
    ||decode(max(          MV_STALEOBJ_MISMATCH),'Y',         ' MV_STALEOBJ_MISMATCH')
    ||decode(max(      FLASHBACK_TABLE_MISMATCH),'Y',     ' FLASHBACK_TABLE_MISMATCH')
    ||decode(max(          LITREP_COMP_MISMATCH),'Y',         ' LITREP_COMP_MISMATCH')
    reason
    from
       v$sql_shared_cursor
    group by
       address
    ) join v$sqlarea using(address) where version_count>2
    and parsing_schema_name like 'APEX_0%'
    order by version_count desc,address

    I'm seeing the same thing now, APEX 4.0. Two-node setup. Please let me know if you've found any reason why, I'm checking the environment settings across both nodes now.

  • "latch: row cache objects" and high "VERSION_COUNT"

    Hello,
    we are being faced with a situation where the database spends most of it's time waiting for latches in the shared pool (as seen in the AWR report).
    All statements issued by the application are using bind variables, but what we can see in V$SQL is that even though the statements are using bind variables some of them have a relatively high version_count (> 300) and many invaliadations (100 - 200) even though the tables involved are very small (some not more than 3 or 4 rows).
    Here is some (hopefully enough) information about the environment
    Version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production (on RedHat EL 5)
    Parameters:
    cursor_bind_capture_destination       memory+disk
    cursor_sharing                        EXACT
    cursor_space_for_time                 FALSE
    filesystemio_options                  none
    hi_shared_memory_address              0
    memory_max_target                     12288M
    memory_target                         12288M
    object_cache_optimal_size             102400
    open_cursors                          300
    optimizer_capture_sql_plan_baselines  FALSE
    optimizer_dynamic_sampling            2
    optimizer_features_enable             11.2.0.2
    optimizer_index_caching               0
    optimizer_index_cost_adj              100
    optimizer_mode                        ALL_ROWS
    optimizer_secure_view_merging         TRUE
    optimizer_use_invisible_indexes       FALSE
    optimizer_use_pending_statistics      FALSE
    optimizer_use_sql_plan_baselines      TRUE
    plsql_optimize_level                  2
    session_cached_cursors                50
    shared_memory_address                 0The shared pool size (according to AWR) is 4,832M     
    The buffer cache is 3,008M     
    Now, my question: is a version_count of > 300 a problem (we have about 10-15 of those with a total of ~7000 statements in v$sqlarea). Those are also the statements listed in the AWR report at the top in the section "SQL ordered by Version Count" and "SQL ordered by Sharable Memory"
    Is it possible that those statements are causing the the latch contention in the shared pool?
    I went through https://blogs.oracle.com/optimizer/entry/why_are_there_more_cursors_in_11g_for_my_query_containing_bind_variables_1
    The tables involved are fairly small and all the execution plans for each cursor are identical.
    I can understand some of the invalidations that happen, because we have 7 schemas that have identical tables, but from my understanding that shouldn't cause such a high invalidation number. Or am I mistaken?
    I'm not that experienced with Oracle tuning at that level, so I would appreciate any pointer on how I can find out where exactly the latch problem occurs
    After flushing the shared pool, the problem seems to go away for a while. But apparently that is only fighting symptoms, not fixing the root cause of the problem.
    Some of the statements in question:
    SELECT * FROM QRTZ_SIMPLE_TRIGGERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2
    UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = :1 WHERE TRIGGER_NAME = :2 AND TRIGGER_GROUP = :3 AND TRIGGER_STATE = :4
    UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = :1 WHERE JOB_NAME = :2 AND JOB_GROUP = :3 AND TRIGGER_STATE = :4
    SELECT TRIGGER_STATE FROM QRTZ_TRIGGERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2
    UPDATE QRTZ_SIMPLE_TRIGGERS SET REPEAT_COUNT = :1, REPEAT_INTERVAL = :2, TIMES_TRIGGERED = :3 WHERE TRIGGER_NAME = :4 AND TRIGGER_GROUP = :5
    DELETE FROM QRTZ_TRIGGER_LISTENERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2So all of them are using bind variables.
    I have seen that the columns used in the where clause all have histograms available. Would removing them reduce the number of invalidations?
    Unfortunately I did not save the information from v$sql_shared_cursor before the shared pool was flushed, but most of the invalidations occurred in the ROLL_INVALID_MISMATCH column if that is of any help. There are some invalidations reported for AUTH_CHECK_MISMATCH and TRANSLATION_MISMATCH but to my understanding they caused by executing the statement for different schemas if I'm not mistaken.
    Looking at v$latch_missed, most of the waits for parent = 'row cache objects' are for "kqrpre: find obj" and "kqreqd: reget"

    >
    In the AWR report, what does the Dictionary Cache Stats section say?
    >
    Here they are:
    Dictionary Cache Stats                                                                                                     
    Cache                 Get Requests      Pct Miss     Scan Reqs    Mod Reqs      Final Usage                                
    dc_awr_control        65                0.00         0            2             1                                          
    dc_constraints        729               33.33        0            729           1                                          
    dc_global_oids        60                23.33        0            0             31                                         
    dc_histogram_data     7,397             10.53        0            0             2,514                                      
    dc_histogram_defs     21,797            9.83         0            0             5,239                                      
    dc_object_grants      4                 25.00        0            0             12                                         
    dc_objects            27,683            2.29         0            223           2,581                                      
    dc_profiles           1,842             0.00         0            0             1                                          
    dc_rollback_segments  1,634             0.00         0            0             39                                         
    dc_segments           7,335             6.94         0            360           1,679                                      
    dc_sequences          139               5.76         0            139           19                                         
    dc_table_scns         53                100.00       0            0             0                                          
    dc_tablespace_quotas  1,956             0.10         0            0             4                                          
    dc_tablespaces        17,488            0.00         0            0             11                                         
    dc_users              58,013            0.03         0            0             164                                        
    global database name  4,261             0.00         0            0             1                                          
    outstanding_alerts    54                0.00         0            0             9                                          
    sch_lj_oids           4                 0.00         0            0             2                                          
    Library Cache Activity                                                                                                     
    Namespace             Get Requests     Pct Miss     Pin Requests          Pct Miss      Reloads   Invalidations            
    ACCOUNT_STATUS        3,664            0.03         0                                   0         0                        
    BODY                  560              2.14         2,343                 0.60          0         0                        
    CLUSTER               52               0.00         52                    0.00          0         0                        
    DBLINK                3,668            0.00         0                                   0         0                        
    EDITION               1,857            0.00         3,697                 0.00          0         0                        
    INDEX                 99               19.19        99                    19.19         0         0                        
    OBJECT ID             68               100.00       0                                   0         0                        
    SCHEMA                2,646            0.00         0                                   0         0                        
    SQL AREA              32,996           2.26         1,142,497             0.21          189       226                      
    SQL AREA BUILD        848              62.15        0                                   0         0                        
    SQL AREA STATS        860              82.09        860                   82.09         0         0                        
    TABLE/PROCEDURE       17,713           2.62         26,112                4.88          61        0                        
    TRIGGER               1,704            2.00         6,737                 0.52          1         0                        

  • AUTH_CHECK_MISMATCH

    Hi all
    I am seeing too many AUTH_CHECK_MISMATCH in v$sql_shared_cursor.
    There is and .net application that login oracle via user X ,all packages these using by application are in user Y.X has only execute permission on all Y packages.
    This might be reason of AUTH_CHECK_MISMATCH ? Or have you any advice ?
    there is not same table names in diffrent schemas and there is not synonyms that related problem tables.Also I am not using VPD.

    Are you sure that there is no change on NLS related values?
    If you have LANGUAGE_MISMATCH without any NLS modification, it would be a bug.
    1. You might like to have more investigation using v$ses_optimizer_env and/or v$sql_optimizer_env views.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_3.htm#REFRN30308
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_3.htm#REFRN30311
    Could you post the result when you have any meanginful comparsion through these views?
    2. And search metalink for bugs.
    ==================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    ==================================

  • A problem with Threads and loops.

    Hi, I have some code that needs to be constantly running, like while(true)
          //code here
    }However, the code just checks to see if the user has input anything (and then if the user has, it goes to do some other stuff) so I don't need it constantly running and hogging up 98% of the CPU. So I made my class (which has the method that needs to be looped, call it ClassA) implement Runnable. Then I just added the method which needed to be looped into the public void run()
    I have another class which creates an instance of the above class (call it ClassB), and the main(String[] args) is in there.
    public static void main(String[] args)
              ClassA test = new ClassA();
              Thread thread = new Thread(test.getInstanceOfClassA());
              thread.start();
              while(true)
                           //I do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...) but I can't think of away to get it to run - sleep - run -sleep forever. Can someone help me?

    Hi, I have some code that needs to be constantly
    running, like while(true)
    //code here
    }However, the code just checks to see if the user has
    input anything (and then if the user has, it goes to
    do some other stuff) so I don't need it constantly
    running and hogging up 98% of the CPU. Where does the user input come from. Are you reading from an InputStream? If so, then your loop will be blocked anyway when reading from the InputStream until data is available. During that time, the loop will not consume processor cycles.
    public static void main(String[] args)
              ClassA test = new ClassA();
    Thread thread = new Thread(test.getInstanceOfClassA());I have never seen this idiom. If ClassA instanceof Runnable, you simply write new Thread(test).
              thread.start();
              while(true)
    //I do not know what to put
    do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...)Yeah, why would you want to call it more than once given that you have an infinite loop in ClassA.run()?
    Harald.
    Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with Threads and "plase wait..."-Window

    Hi everyone,
    I have a problem that I'm not able to solve in any way... I have a time-consuming task (a file decryption) which I execute in a separate thread; I've used the SwingWorker class, like suggested by sun-tutorial, and it works right. The problem is that I have to wait that the decryption have finished before continuing with program-execution. Therefore I would like to display a "please wait"-window while the task runs. I've tryed all the possible ways I know but the problem is always the same: the waitWindow is displayed empty, the bounds are painted but the contents no; it's only painted when the decrypt-task has finished. Please help me, I have no more resources....
    decrypt-file code:
    public class DecryptFile {
      private String cryptedFileNameAndPath;
      private ByteArrayInputStream resultStream = null;
      // need for progress
      private int lengthOfTask;
      private int current = -1;
      private String statMessage;
      public DecryptFile(String encZipFileNameAndPath) {
        cryptedFileNameAndPath = encZipFileNameAndPath;
        //Compute length of task...
        // 0 for indeterminate
        lengthOfTask = 0;
      public ByteArrayInputStream getDecryptedInputStream() {
        return this.resultStream;
       * Called from ProgressBarDemo to start the task.
      public void go() {
        current = -1;
        final SwingWorker worker = new SwingWorker() {
          public Object construct() {
            return new ActualTask();
        worker.start();
       * Called from ProgressBarDemo to find out how much work needs
       * to be done.
      public int getLengthOfTask() {
        return lengthOfTask;
       * Called from ProgressBarDemo to find out how much has been done.
      public int getCurrent() {
        return current;
      public void stop() {
        current = lengthOfTask;
       * Called from ProgressBarDemo to find out if the task has completed.
      public boolean done() {
        if (current >= lengthOfTask)
          return true;
        else
          return false;
      public String getMessage() {
        return statMessage;
       * The actual long running task.  This runs in a SwingWorker thread.
      class ActualTask {
        ActualTask () {
          current = -1;
          statMessage = "";
          resultStream = AIUtil.getInputStreamFromEncZip(cryptedFileNameAndPath); //here the decryption happens
          current = 0;
          statMessage = "";
      }The code that calls decryption and displays waitWindow
          final WaitSplash wS = new WaitSplash("Please wait...");
          final DecryptFile cryptedTemplate = new DecryptFile (this.templateFile);
          cryptedTemplate.go();
          while (! cryptedTemplate.done()) {
            try {
              wait();
            } catch (Exception e) { }
          this.templateInputStream = cryptedTemplate.getDecryptedInputStream();
          wS.close();Thanks, thanks, thanks in advance!
    Edoardo

    Maybe you can try setting the priority of the long-running thread to be lower? so that the UI will be more responsive...

  • Problem with threads and graphics

    I have a thread that chooses paths for a Travelling salesman problem, it then calls a TSPdraw class and passes it the path, which the class then draws. the problem is when i have two threads it creates two windows but only draws a path in one of them. any ideas where i`m going wrong

    Are you using swing components? Swing isn't threadsafe. If you have multiple threads that want to update your UI you need to use the SwingUtilities.invokeLater(...)or invokeAndWait(...). There is a page in the swing tutorial about this at: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

  • Problem with threads and ProgressMonitor

    Dear Friends:
    I have a little problem with a thread and a ProgressMonitor. I have a long time process that runs in a thread (the thread is in an separate class). The thread has a ProgressMonitor that works fine and shows the tasks progress.
    But I need deactivate the main class(the main class is the user interface) until the thread ends.
    I use something like this:
    LongTask myTask=new LongTask();
    myTask.start();
    myTask.join();
    Now, the main class waits for the task to end, but the progress monitor don`t works fine: it shows only the dialog but not the progress bar.
    What's wrong?

    Is the dialog a modal dialog? This can block other UI updates.
    In general, you should make sure that it isn't modal, and that your workThread has a fairly low priority so that the UI can do its updating

  • Problem with threads and/or memory

    I'm developing an application where there are 3 threads. One of them sends a request to the other, and if the 2nd can't answer it, it sends it to the 3rd (similar to CPU -> CACHE -> MEMORY). When i run the program with 1000-10.000 requests, no problem occurs. When i run it with 300.000-1.000.000 requests, it sometimes hangs. Is this a problem with the garbage collector, or should it be related to the threads mecanism.
    (note: eache thread is in execution using a finite state machine)

    i had been running the program inside Netbeans.
    Running the jar using the command line outside
    Netbeans i have no more problems... Does Netbeans use
    it's own JVM?Depends how you set it up, but look under the options. There are settings for the compiler and jvm that it uses.

  • Null And " "

    What is the difference between these two lines of codes?
    String currentFile = null;
    String currentFile = "";
    Edited by: AMARSHI on Jul 10, 2008 7:07 AM

    The reference variable itself, takes up the same amount of space, of course, as all references are the same size. Now, the object on the heap is a different story. With null there isn't one, of course (or if there is there is only one for the entire VM), and for the second a String object will be created in the String pool (once again, only one for the entire VM that every = "" assignment will use). But really, what difference does it make? If there is a difference, it is on the order of a few bytes (at max) for the entire VM, and if this is a concern, your probably doing something else greviously wrong. This miniscule difference should not concern you.
    Edit: And "nulling" variables to "save" memory is also not something you should be concerned with. Either the variable will go out of scope and the object garbage collected anyway, or it's in constant use and so will not be taking up any extraneous heap space. If one of those is not the case, you are, once again, doing something greviously wrong.

  • And/or if statement in rtf templates.

    Hi all,
    I'm using XML Publisher 4.5.
    I have created a word template file (rtf) for my reports. I need to be able to show some content in the template file by using and and/or if statement.
    fx. <?if:doc_type='STANDARD'?> OR <?if:doc_type='DEFAULT'?>
    How can I do this?
    In advance thank you.
    Best regards
    Kenneth

    Hi D,
    Thank you for your answer.
    I have seriously thought about that solution; but I don't think it's a smart way to do it.
    If i do it like that, i need to copy the whole table and paste it inside the if statements.
    I have two xml elements that I need to make the decisions on. POH_PO_TYPE & CP_RELEASE_NUM.
    POH_PO_TYPE can be: STANDARD, RELEASE or BLANKET.
    CP_RELEASE_NUM can be: '' or N
    If POH_PO_TYPE is RELEASE AND CP_RELEASE_NUM is not ''
    OR POH_PO_TYPE is STANDARD
    OR POH_PO_TYPE is BLANKET AND CP_RELEASE_NUM is ''
    THEN show table (which contains the whole PO).
    It shall show the content of the PO in any of these cases.
    BR Kenneth

  • I install window 8 and Unfortunatly all drive format. And all drive mix, now i have only 1 DRIVE C. I want Bit locker Drive's data Back

    Last sunday i install a window 8 and this window format my all drive & make it 1 drive (DRIVE C). Before all of this i have 5 drive in different size with 1 Bitlocker protect drive.
    So i try data recovery software to recover my data. i got back all my data without that ( bitlocker ) protected drive.
    so please guys help me how can i get back data from bitlocker protected drives.
    please please help me.

    Hi,
    I sorry for your experience, but there is no way to recovery the data encryped by BitLocker untill now.
    BitLocker is designed to make the encrypted drive unrecoverable without the required authentication. When in recovery mode, the user needs the recovery password or recovery key to unlock the encrypted drive. Therefore, we highly recommend
    that you store the recovery information in AD DS or in another safe location.
    Please refer to the link below for the statement:
    http://technet.microsoft.com/de-de/library/ee449438(v=ws.10).aspx#BKMK_RecoveryInfo
    Roger Lu
    TechNet Community Support

  • Open and cancelled Quote Report

    Hi,
    Can anyone give me the information  for getting open and cancelled Quote Report?

    I hope you are using reason for rejection for cancelling quotations. If that is the case, you can use transaction VA25 to view the list of quotations. Here you can filter on two columns status and reason for rejection to view the report as per your requirement.
    Regards,
    GSL.

Maybe you are looking for

  • Marantz iPod dock not feeding video signal to tv

    I have the Marantz IS201 iPod dock, which works fine for audio, and talks to the tv fine in terms of displaying iPod data on the screen. But when I actually try and play videos or photos, no joy - most I get is the little play arrow at top left of sc

  • Logic to get stock in hand.

    Hi All! What is the logic for the stcok in hand. There are several stocks like restricted stock,blocked stock,stock in quality inspection etc.. How can i get the total in hand Regards Praneeth

  • Info Record Price

    Hi !! My PO is of date 01.01.2010 & now I changed Info record price from date 01.01.2010 & today is 10.04.2010,but how this will be changed in PO.

  • Performance slowdown when running through report server

    There is a considerable difference between running a particular report through the report server. It is slower than when run directly from ReportBuilder. Each points to the same data/application server. There is very little formatting or other work r

  • How do I insert a space between each letter? i.e. ABC becomes A B C

    I have a long strand of characters that I would like to insert spaces between and doing it manually is not practical. Can anyone suggest a shortcut or a way to save me a day of sitting and hitting right arrow space bar??