TRACE EVENT 세팅에 대하여

제품 : ORACLE SERVER
작성날짜 : 2003-08-04
trace event를 세팅에 대하여
init.ora에 특별한 파라메터를 세팅하므로서 memory나 디스크 corruption에대해
분석할 수있는 방법이 있다. 이러한 파라메터들은 performance에 영향을 줄 수
있으므로 정상적인 상태에서는 세팅하지 않는다. 여기서는 event information을
모으기 위한 시간을 절약하는데 목적이 있으며 몇개의 event 세팅의 보기를 보여
준다. 여기서 보여지는 것 말고도 많은 event들이 있으며 그것들은 그때그때의
필요에 의해 세팅되어 진다.
Event trace를 하기 위한 방법에는 두 가지가 있다. 첫번째는 init.ora에 세팅
하는 것이며 이것은 모든 세션에 영향을 미친다. 두번째 방법은 alter session
set events 명령어를 이용하는 것이며 현재 세션에만 영향을 미친다.
Syntax는 다음과 같다.
Event = "event syntax | , LEVEL n | : event syntax | , LEVEL n | .. "
sql 문장을 이용한 syntax는 다음과 같다.
SQL> alter session set events 'event syntax LEVEL n: event syntax
LEVEL n: ...';
예를들어 콘트롤 화일의 전체 내용을 보기 위한 syntax는 다음과 같다.
SQL> alter session set events 'IMMEDIATE TRACE NAME CONTROLF LEVEL 10';
event syntax는 여러개의 키워드를 가지고 있다. 첫번째의 키워드는 event
number이거나 special keyword, 즉 IMMEDIATE일 수 있다. Event number는
오라클 에러 번호이거나 internal error code일 수 있다. Event code는
그 값에 따라 action이 발생되는 커널의 logic에 의해 결정된다. 이러한 내부
event code는 /rdbms/mesg/oraus.msg 화일에 있다. 다른 operating system에
서는 상기 화일이 binary format이거나 text가 아닐 수 있다. Internal event
code는 10000 - 20000의 범위에 있다.
만약 IMMEDIATE라는 키워드가 첫번째 나온다면 이것은 unconditional event
임을 나타낸다. 그리고 그 결과는 이 명령어가 사용된 직후 발생된다. 이러한
명령어는 alter session 라. 명령어에서만 효과가 있고 init.ora에서 설정된
문장은 효과가 없다.
두번째와 세번째 키워드는 각각 대부분 TRACE와 NAME이다. TRACE라는 키워드는
output이 trace file로 dump될 것을 의미하며 NAME이라는 키워드는 실제 event
name 바로 앞에 온다. TRACE말고도 다른 키워드가 올 수 있으나 그것들은 오라
클의 개발팀을 위해 사용된다. 마지막 키워드는 event name으로 실제 dump할
내용을 정한다.
만약 IMMEDIATE 키워드를 사용하지 않는다면 얼마나 오래동안 trace를 할지를
지정해야 한다. FOREVER 키워드를 사용했을때에는 해당 session이나 instance가
살아있는 시점까지 event는 살아있게 된다.
Event 문장 다음에는 대부분의 event에서 LEVEL 키워드가 세팅된다. 만약 level
이 없다면 errorstack을 dump하는 동안 exception이 발생할 수 있다. 일반적
으로 LEVEL은 1에서 10까지의 범위를 갖는다. 10은 그 event에 대해서 전체
내용을 전부 dump할 것을 의미한다.
예를들어 LEVEL을 1로 했을때에는 control file을 dump할때 control file
header만을 dump하지만 10이면 전체 내용을 dump한다. BLOCKDUMP키워드 일때
에는 LEVEL은 특별한 의미를 가지며 그것은 datablock의 실제 주소가 십진수로
표시된다.
이제 몇개의 예를 들어 보자. 다음은 init.ora 에 세팅될 수 있는 내용이다.
EVENT = "604 TRACE NAME ERRORSTACK FOREVER"
EVENT = "10210 TRACE NAME CONTEXT FOREVER, LEVEL 10"
첫번째 문장은 process가 ORA-604를 만날때마다 error stack을 dump하게 될 것
이다. 두번째 문장은 디스크에서 캐쉬로 블록을 읽을때 block integrity를 체크
하는 event이다.
다음 문장들은 SQL을 통해서 event를 세팅하는 예를 보인다.
SQL> ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME BLOCKDUMP
LEVEL 67109037';
SQL> ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME CONTROLF
LEVEL 10';
SQL> ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE
LEVEL 10';
첫번째 문장은 데이타블록 67109037을 trace file로 dump할 것이다. 모든
오라클 데이타베이스의 데이타블록은 block number와 file number의 유일한
값으로 되어 있다. 상기예에서 67109037은 block number와 file number와의
십진표현법이다. 이러한 정보는 operating system dependent하다. 두번째
문장은 전체 콘트롤화일의 내용을 trace file로 dump한다.
세번째 문장은 system state 를 trace로 dump한다. (system state는 현재
RDBMS에 의해 잡혀있는 object에 대한 정보를 보여주며 process state dump는
특정 process에 잡혀있는 object에 대한 process state dump를 보여준다)
이러한 정보는 system hang problem과 같은 문제의 분석에 유용할 수 있다.
EVENT NAMES
여기서는 사용가능한 event에 대한 감각을 익히기 위해서 몇개의 event name을
들어 설명한다.
- ERRORSTACK
오라클은 어떤 process가 특별한 에러를 만났을때 그에 관련된 정보를 저장하기
위해 "error stack"을 생성한다. Oracle foreground process는 에러 메세지를
받는다. Application 운영중에는(Developer/2000 Forms) 에러와 관련된 자세한
정보를 foreground process는 받지 못한다.
이 event는 전체 에러 스택을 trace로 dump해 주며 oracle error를 debugging
하는데 유용하게 이용할 수 있다. 예를들어 application이 ora-604와 함께
실행이 중단되면
SQL> alter session set events '604 trace name errorstack forever';
은 에러 스택을 trace file로 생성시켜 줄 것이다.
- SYSTEMSTATE
이 event는 전체 system state를 dump하며 이것은 모든 프로세스의 state dump
를 포함한다.
Performance degradation, process hang이나 system hang을 분석하는데 있어서
유용하다.
SQL> alter session set events 'immediate trace name systemstate
level 10';
- EVENT CODE 10013 AND 10015
이것들은 corrupted rollback segment 문제를 분석하는데 사용될 수 있다.
이러한 경우에 데이타베이스는 startup 할 수 없고 ora-1578에러를 발생한다.
만약 원인이 rollback에 있는 것으로 판단됐을때 init.ora에 상기 event를 세팅
하면 trace 화일을 생성할 것이다. syntax는 다음과 같다.
Event = "10015 trace name context forever"
- EVENT CODES 10210 AND 10211
이것들은 block checking,가 event checking event들이다. 일반적으로 디스크
블록이 캐쉬로 읽어들여질때 기본적인 integrity checking이 수행된다. 상기
event들을 세팅하므로서 오라클은 부가적인 check을 하게되며 이것은 block
corruption을 분석하는데 결정적이다. PMON은 항상 block checking을 가능한
상태로 유지하고 있다. 정상적인 상태에서도 block-checking이나 index-
checking을 수행하는 것이 좋을 수도 있으나 over head가 있다.
Event = "10210 trace name context forever, level 10"
- EVENT CODES 10231 AND 10232
정전으로 인해 디스크의 한 블록 전체의 내용이 없어질 수 있다. 그런 상황에서
그 테이블의 자료를 살려내기 위해 일반적으로 export를 받는다. 그러나 full
table scan은 bad block을 만났을때 실패할 것이다. 이러한 상황을 피해가기
위해 event 10231의 세팅이 필요하다. 이 event는 full table scan시
corrupted block을 skip할 것이다. Event 10232가 세팅된다면 corrupted
block을 trace file로 dump된다. 이러한 event를 세팅하기 위해서는 몇몇 조건
들이 필요하다.
. 이러한 블록은 오라클에 의해 soft-corrupted되어야 한다. 즉 오라클이
corrupt block을 발견할 때 그 블록에 어떤 bit을 세팅하므로서 손상되었다고
표시한다. 오라클이 soft-corrupt block을 하기 위해서는 event 10210을 세팅
해야 한다. 그러므로 event 10210과 함께 10231이 쓰이는 것이 권장된다.
. 인덱스를 이용하여 해당 블록을 접근하는 것은 안되며, 단지 full table
scan만이 수행 되어야 한다. 만약 손상된 테이블을 export하려면 이러한 event
를 init.ora에 세팅해 놓아야 한다.
SQL> alter session set events *10231 trace name context off*;
Event = "10231 trace name context forever, level 10"
첫번째 문장은 세션에서 lock-checking 을 더 이상 하지 않게 하며 두번째는
block-checking을 실행하게 된다.
Reference Documents
<Note:1051056.6>
<Note:21184.1>

Thanks Ray.
I was wrong. The event is fired even if i enable it before the callback VI registration.
The problem was that, just to discover if the callback VI was called, i put some code in its block diagram that would have changed the state of a boolean control placed on its front panel, every time the callback VI was called.
Apparently this is not allowed and the boolean didn't change its state.
I solved linking the code in the callback VI to a boolean placed on another front panel (in this case on the main VI one). In this way i succeded whatching the boolean state change.

Similar Messages

  • How using sql trace event  10128 level 1&2

    hi all,i want ask about sql trace event 10128. how using sql trace event 10128 level 1&2??
    when I've enabled sql trace event 10128 level 2,and i execution query then appears error
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00942: table or view does not exist
    where the fault lies??
    i'm using
    ALTER SYSTEM SET timed_statistics=TRUE;
    ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2';

    But nothing issue with me on 10g on windows xp:
    SQL> ALTER SYSTEM SET timed_statistics=TRUE;
    System altered.
    SQL> ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2';
    ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2'
    ERROR at line 1:
    ORA-00927: missing equal sign
    SQL> ALTER SESSION SET EVENTS
      2      '10128 trace name context forever, level 2';
    Session altered.
    SQL>HTH
    Girish Shamra
    Edited by: Girish Sharma on Dec 9, 2009 11:46 AM
    This is not "EVENT" .. it is "EVENTS"

  • Ask result sql trace events 10046 level 8 and 12

    hi all, i read result of sql trace events 10046 level 8 on
    http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php#trace_example
    and I do sql trace event 10046 level 8 or 12. But the results did not same, execution plan does not appear
    how to have execution plan appears??

    We use level 12 and we have both RSO (row source operation) and execution plan. Remember, execution plan is just the preditive estimate execution path by the opimizer. RSO is actually how the optimizer executes.
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 12'
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.01 0.00 0 66 1 1
    total 3 0.02 0.01 0 66 1 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 1767 (DELTEK) (recursive depth: 2)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=66 pr=0 pw=0 time=8793 us)
    4732 TABLE ACCESS SAMPLE Z_PJPCOMPR_UPSUM47 (cr=66 pr=0 pw=0 time=74 us)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: HINT: ALL_ROWS
    1 SORT (AGGREGATE)
    4732 TABLE ACCESS (SAMPLE) OF 'Z_PJPCOMPR_UPSUM47' (TABLE)

  • 10046 trace event

    Hi! please! help me find out about "10046 trace event" ...
    how to read this, is there any technique involved !..
    if you have any web links then do share it with me, any sort of documentation will be very helpful to me...
    cheers'
    Amit

    Time to buy, Carry and Jeff's, award winning book of 2004, 'Optimizing Oracle Performance'. They have explained about the trace in-detail. Worthy to have a copy of it.
    For time being, go to, www.hotsos and download papers related to 10046event from their library.
    Jaffar

  • Occurance of trace event in oracle

    Hi ,
    Wishing all a happy Eid ....
    I have question on  trace enabling of Oracle database .
    Suppose I have enabled a trace event  "alter system set events '1031 trace name errorstack level 3';"
    Qusetion-1 : - Will this trace event able to create a trace file in udump dest for the users who are already logged in before the trace event  enabled .,
                   Meaning - Suppose I am enabling the trace event (ex-1031) on 9 AM , will this event able to create a trace file for the users
                   who have logged in at 7AM and at 9:30 AM ora-1031 will raise from their session. 
    Question -2 - After enabling the trace on instance/system level ,how can i check the enabled event ...
                  Meaning - Is there any query/command to check the above trace level (1031) is enabled or not ....
    Thanks

    1.  Try it.
    2.  Search dbms_system.read_ev on Oracle DBMS_SYSTEM , though see note.
    Also see Spying on the other session | Dion Cho - Oracle Performance Storyteller

  • "Rows" statistics from STAT in trace event 10046, Oracle 11g.

    Hi, all!
    Why "Rows" statistics in STAT are different for 10g and 11g?
    I have two database with version 10g and 11g, with the same data.
    I executed some pl/sql code with tracing 10046 level 8.
    And I have different result when obtain raw trace.
    In 10g I obtain rows statistics for all executions - Rows= 7.
    In 11g I obtain rows statistics for first executions - Rows= 1. Why?
    See my example:
    declare
         type t_name_tbl is table of varchar2(30) index by binary_integer;
         v_name_tbl t_name_tbl;
         v_len      number := 10;
    begin
         execute immediate 'alter session set timed_statistics = true ';
         execute immediate 'alter session set statistics_level=all ';
         execute immediate 'alter session set max_dump_file_size = unlimited ';
         execute immediate 'alter session set events ''10046 trace name context forever,level 8'' ';
         loop
           select cour_name bulk collect
                into v_name_tbl
               from country t
              where length(t.cour_name) = v_len;
           exit when v_len = 0;
           v_len := v_len - 1;
           for i in 1 .. v_name_tbl.count loop
             dbms_output.put_line(v_name_tbl(i));
           end loop;
         end loop;
    end;Result Tkprof for Oracle 10g:
    SELECT COUR_NAME
    FROM
    COUNTRY T WHERE LENGTH(T.COUR_NAME) = :B1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute     11      0.00       0.00          0          0          0           0
    Fetch       11      0.01       0.00          0         44          0           7
    total       23      0.01       0.00          0         44          0           7
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 649     (recursive depth: 1)
    Rows     Row Source Operation
          7  TABLE ACCESS FULL COUNTRY (cr=44 pr=0 pw=0 time=1576 us)Result Tkprof for Oracle 11g:
    SQL ID: 3kqmkg8jp5nwk
    Plan Hash: 1371235632
    SELECT COUR_NAME
    FROM
    COUNTRY T WHERE LENGTH(T.COUR_NAME) = :B1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute     11      0.02       0.01          0          0          0           0
    Fetch       11      0.00       0.01          3         44          0           7
    total       23      0.03       0.02          3         44          0           7
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 82     (recursive depth: 1)
    Rows     Row Source Operation
          1  TABLE ACCESS FULL COUNTRY (cr=4 pr=3 pw=0 time=0 us cost=2 size=44 card=2)Were can I read about it?

    Oracle 11g by default writes the execution plan (the STAT lines in the raw trace file) after the first execution of the SQL statement, while prior to 11g the execution plan is written only when the cursor is closed.
    The behavior in 11g can be controlled by changing the PLAN_STAT parameter of the call that enables the trace from the default value of FIRST_EXECUTION to ALL_EXECUTIONS:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_sessio.htm#i1010518
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.
    Edited by: Charles Hooper on Aug 9, 2010 3:33 PM
    Default value on 11g is FIRST_EXECUTION, while the behavior prior to 11g is ALL_EXECUTIONS - corrected the incomplete sentence.

  • Disable trace event

    Hi,
    I have enable a trace and now i want to disable this event trace. How can i do this??
    The command that i use to enable is the following:
    alter system set events '1349 trace name context forever, level 7'
    Tks,
    Paulo.

    Oops!!!
    I done worng
    alter system set events '1349 trace name context off, level 7';
    Tks,
    Paulo.

  • 10046 trace event - Missing privileges

    Hi,
    Version 11201
    Please advice what privileges are missing :
    SQL> ALTER SESSION SET events '10046 trace name context forever, level 12';
    ERROR:
    ORA-01031: insufficient privileges
    Thanks

    AllYourDataBase wrote:
    I would guess the "alter session" privilege.I'd also guess that, but i have the documentation to prove it as well :)
    http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/appendixa.htm#CHDIBAJE
    Note that the ALTER SESSION privilege is required for setting events. Very few database users should require the alter session privilege.
    SQL> ALTER SESSION SET EVENTS ........
    The alter session privilege is not required for other alter session commands.
    SQL> ALTER SESSION SET NLS_TERRITORY = FRANCE;
    "

  • Trace events for Transport creation.

    Hi Guru's,
    I am hoping to run a program when a transport is created or changed. Thus I was trying to find if any events are raised when a transport is created.
    I am struggling to firstly find out how to trace which events are raised and secondly to see if there is a suitable event I can use.
    If anyone has any idea how I can run a program when a transport is changed or created that would be fantastic.
    Ross.

    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    JServer Release 9.2.0.7.0 - Production
    SQL> execute sys.dbms_system.set_bool_param_in_session(22,658,'sql_trace',true);
    PL/SQL procedure successfully completed.
    SQL> execute sys.dbms_system.set_int_param_in_session(22,658,'max_dump_file_size',10000000);
    PL/SQL procedure successfully completed.
    SQL> execute sys.dbms_system.set_ev(22,658,10046,12,' ');
    PL/SQL procedure successfully completed.
    SQL> execute sys.dbms_system.set_ev(22,658,10046,0,' ');
    PL/SQL procedure successfully completed.
    SQL>
    ==================================
    oracle:/user/app/oracle/admin/INS/udump>ll
    total 36
    -rw-rw---- 1 oracle oinstall 1695 Aug 9 09:29 ins_ora_2530.trc
    -rw-rw---- 1 oracle oinstall 26596 Aug 8 16:37 ins_ora_3352.trc
    -rw-rw---- 1 oracle oinstall 1701 Aug 9 13:53 ins_ora_3630.trc
    oracle:/user/app/oracle/admin/INS/udump>
    ================================================
    parameters from the initialisation file
    db_block_size=8192
    db_block_checksum=FALSE
    background_dump_dest=$ORACLE_BASE/admin/INS/bdump
    user_dump_dest=$ORACLE_BASE/admin/INS/udump
    core_dump_dest=$ORACLE_BASE/admin/INS/cdump
    log_archive_dest="$ORACLE_BASE/admin/INS/archive"
    log_archive_start=TRUE
    log_archive_format="%t_%s.ARC"
    please suggest
    Altaf

  • R12: Form Trace event 135 - DB Processing

    Hi All,
    I enabled form trace for my Ebiz user. I set form runtime parameter to "record=forms tracegroup=32,64,98,100,101,135,136,137"
    As per document event number 135 is for "DB Processing (Start & End)" but I dont see any of these event recorded in trace file (in xml file). I see event 136 (DB Logon) and 137 (DB Logoff) but I dont see the processing time.
    I want to know exactly how much time the form spent in database (querying or executing some packages).
    But what I see is DB Logon at the start and DB Logoff at the end. So that is almost the entire duration I used the form. But I want to find out how much time it actually spent in database.
    Please advise.
    Thanks,
    AppsDBA

    Hi,
    Were you able to test other event numbers and see if it works (just to verify that events work with the way you obtain the trace file).
    If other events work, try to use events between 97 and 101 (mainly 98 and 101) and see if it helps.
    8.5 List of Traceable Events
    http://download.oracle.com/docs/cd/B14099_19/web.1012/b14032/tracing005.htm#i1044390
    If none of the above helps, you may need to log a SR then.
    Thanks,
    Hussein

  • A lot of trace events on a basic query

    Hi All,
    We are struggling with a strange olap engine behavior on resolving basic MDX query on any measure
    even without any dimensions attributes involved. (on clear cache) 
    Enormous amount of Starting/Finishing Reading from Aggregation 0 emitted. (Progress Report Event; 14-Query sub event).
    We commented out all mdx script and enabled one native measure (count),
    but this take no effect. The product version is 2012 sp2.
    Has anyone ever met this issue before? 

    Hi Dimitri,
    According to your description, you can't execute MDX query at all. Right?
    In this scenario, pelase make sure the SSAS database is not corrupt. Re-deploy your cube and see if any error is thrown. Check the data in tables which are involved in dsv. You can use SQL query to join those tables and query the data in SSMS database engine.
    Go to SQL Server Configuration Manager and Services to see if SQL Server Analysis Services is running. And make sure the log on account has suffcient permission. If possbile please share some sample query and the detail error message.
    Simon Hou
    TechNet Community Support

  • Please explain cr= in 10046 trace event

    #37:c=0,e=18,p=698,cr=99165,cu=12,mis=1,r=0,dep=0,og=4,tim=2345651360
    I know ,
    c: cpu time
    e: elapse time
    p: parse times ( not sure )
    cr: ?
    cu: ?
    mis: number misses in the library cache in parse
    r: ?
    dep: call depth
    og : optimizer goal
    tim: timestamp for call
    Please explain p , cr , cu , r .
    Thanks in advance !

    This link has the information you requested:
    http://www.dba-oracle.com/t_10046_trace_file_parse_execute.htm

  • Event.shiftKey always traces false

    Has anybody else had problems with detecting if
    event.shiftKey is true? It seems ever since I upgraded to 2.0.1
    I've lost the ability to see if the user has shift, crtl'd, or
    alted a key while clicking on something. Below is a function I
    wrote a good amount of time ago that worked for the longest period
    of time and it seems that it stopped working just as soon as I
    upgraded.
    // GLOBAL OPEN LINK FUNCTION
    public function openLink(event:MouseEvent,
    linkURL:String):void {
    trace(event.shiftKey);
    if(event.shiftKey){
    trace(" You ShiftClicked!!!!");
    var request:URLRequest = new URLRequest(linkURL);
    navigateToURL(request, "_blank");
    That function traces false every time no matter what you got
    down on the keyboard. Anyone have ideas or similiar
    problems?

    Well explicitly setting == true didn't seem to change
    anything either. I think that's a bit weird that it traces false
    though. One thing I just thought of is maybe flex just doesn't
    detect my keyboards shift key or something. I'll try a different
    computer later and see if that proves to give me something
    different.

  • Event Dispatch Thread Hangs, what is wrong?

    The Event Dispatch Thread Hangs when showing a modal dialog while running a
    SwingWorker Thread.
    I have included my code at the bottom of the page. There are three classes. I have posted a bug report to red hat. But I want to make sure my code is correct.
    My test case just puts the SwingWorker to sleep
    but the problem occurs if I do something real, like connect to a database, etc.
    Also I have tried little different variations of the logic calling
    setVisible(true)/(false) in different places and the same problem occurs.
    It seems to work with Sun JDK, note I am using IcedTea with Fedora Core 8.
    Version-Release number of selected component (if applicable):
    [szakrews@tuxtel ~]$ java -version
    java version "1.7.0"
    IcedTea Runtime Environment (build 1.7.0-b21)
    IcedTea Client VM (build 1.7.0-b21, mixed mode)How reproducible:
    Every couple times.
    javac TestClass2
    java TestClass2eventually it will hang. If it doesn't try again.
    You don't have to wait for the program to finish either.
    The program runs the Dialog 10 times but it never works or fails in the middle, it will either work or fail from the first dialog displayed.
    I have included a thread dump. That is about the most informative information I can get. Neither tracing nor writing a custom ThreadQueue or Drawing Manager to trace events produces any helpful information.
    Actual results:
    The JProccessBar won't move, and the SwingWorker finishes but the done() method is never run. The PROGRAM is not hung however because if I close the dialog then it will continue.
    Expected results:
    The JProccessBar should always move and the SwingWorker should always run the done() method.
    Additional info:
    java thread dump after freeze, taken with kill -s SIGQUIT <pid>
    2008-06-25 12:25:50
    Full thread dump IcedTea Client VM (1.7.0-b21 mixed mode):
    "DestroyJavaVM" prio=10 tid=0x938afc00 nid=0x1419 waiting on condition
    [0x00000000..0x0018a074]
       java.lang.Thread.State: RUNNABLE
    "AWT-EventQueue-0" prio=10 tid=0x938ae400 nid=0x1429 in Object.wait()
    [0x07f96000..0x07f96f04]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x96748f80> (a java.awt.EventQueue)
            at java.lang.Object.wait(Object.java:503)
            at java.awt.EventQueue.getNextEvent(EventQueue.java:485)
            - locked <0x96748f80> (a java.awt.EventQueue)
            at
    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:248)
            at
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
            at
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:195)
            at java.awt.Dialog$1.run(Dialog.java:1073)
            at java.awt.Dialog$3.run(Dialog.java:1127)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1125)
            at java.awt.Component.show(Component.java:1456)
            at java.awt.Component.setVisible(Component.java:1408)
            at java.awt.Window.setVisible(Window.java:871)
            at java.awt.Dialog.setVisible(Dialog.java:1012)
            at net.xtel.production.WaitDialog.showWaitDialog(WaitDialog.java:72)
            at net.xtel.production.WaitDialog.showWaitDialog(WaitDialog.java:102)
            at TestClass2.showWait(TestClass2.java:79)
            at TestClass2.createAndShowGUI(TestClass2.java:126)
            at TestClass2.access$0(TestClass2.java:114)
            at TestClass2$3.run(TestClass2.java:138)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:227)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:603)
            at
    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:276)
            at
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
            at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)
    "AWT-Shutdown" prio=10 tid=0x938ad000 nid=0x1428 in Object.wait()
    [0x03ea7000..0x03ea7f84]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x96749268> (a java.lang.Object)
            at java.lang.Object.wait(Object.java:503)
            at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:281)
            - locked <0x96749268> (a java.lang.Object)
            at java.lang.Thread.run(Thread.java:675)
    "AWT-XAWT" daemon prio=10 tid=0x938a8400 nid=0x1423 runnable
    [0x02ccc000..0x02ccd104]
       java.lang.Thread.State: RUNNABLE
            at sun.awt.X11.XToolkit.waitForEvents(Native Method)
            at sun.awt.X11.XToolkit.run(XToolkit.java:550)
            at sun.awt.X11.XToolkit.run(XToolkit.java:525)
            at java.lang.Thread.run(Thread.java:675)
    "Java2D Disposer" daemon prio=10 tid=0x93854000 nid=0x1421 in Object.wait()
    [0x07aea000..0x07aead84]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x966e7010> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
            - locked <0x966e7010> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:150)
            at sun.java2d.Disposer.run(Disposer.java:143)
            at java.lang.Thread.run(Thread.java:675)
    "Low Memory Detector" daemon prio=10 tid=0x93c15000 nid=0x141f runnable
    [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "CompilerThread0" daemon prio=10 tid=0x93c13400 nid=0x141e waiting on condition
    [0x00000000..0x03a8a954]
       java.lang.Thread.State: RUNNABLE
    "Signal Dispatcher" daemon prio=10 tid=0x93c11c00 nid=0x141d waiting on
    condition [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "Finalizer" daemon prio=10 tid=0x095e7000 nid=0x141c in Object.wait()
    [0x005d2000..0x005d3004]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x966e71d8> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
            - locked <0x966e71d8> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:150)
            at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)
    "Reference Handler" daemon prio=10 tid=0x095e2400 nid=0x141b in Object.wait()
    [0x00581000..0x00582084]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x966e7260> (a java.lang.ref.Reference$Lock)
            at java.lang.Object.wait(Object.java:503)
            at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:134)
            - locked <0x966e7260> (a java.lang.ref.Reference$Lock)
    "VM Thread" prio=10 tid=0x095dec00 nid=0x141a runnable
    "VM Periodic Task Thread" prio=10 tid=0x93c17400 nid=0x1420 waiting on condition
    JNI global references: 836
    Heap
    def new generation   total 960K, used 152K [0x93f40000, 0x94040000, 0x966a0000)
      eden space 896K,   9% used [0x93f40000, 0x93f56148, 0x94020000)
      from space 64K, 100% used [0x94020000, 0x94030000, 0x94030000)
      to   space 64K,   0% used [0x94030000, 0x94030000, 0x94040000)
    tenured generation   total 4096K, used 1088K [0x966a0000, 0x96aa0000, 0xb3f40000)
       the space 4096K,  26% used [0x966a0000, 0x967b01b0, 0x967b0200, 0x96aa0000)
    compacting perm gen  total 12288K, used 9169K [0xb3f40000, 0xb4b40000, 0xb7f40000)
       the space 12288K,  74% used [0xb3f40000, 0xb4834740, 0xb4834800, 0xb4b40000)
    No shared spaces configured.CLASS1:
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.sql.SQLException;
    import java.util.concurrent.ExecutionException;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.RepaintManager;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    public class TestClass2 extends JFrame implements ActionListener {
            /** Action Command for <code>searchbtn</code> */
            public static final String SEARCH_BTN_ACTION = "search_btn_action";
             * Constructor.
            public TestClass2() {
                    setSize(650, 350);
                    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
                    setLocation(screenSize.width / 2 - getSize().width / 2,
                                    screenSize.height / 2 - getSize().height / 2);
                    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                    addWindowListener(new WindowAdapter() {
                            @Override
                            public void windowClosing(WindowEvent e) {
                                    exit();
                    JPanel panel = new JPanel();
                    add(panel);
                    setVisible(true);
            @Override
            public void actionPerformed(ActionEvent e) {
                    if (e.getActionCommand().equals(SEARCH_BTN_ACTION)) {
                            JOptionPane.showMessageDialog(this, "Button Pressed");
            public void showWait() {
                    try {
                            WaitDialog.showWaitDialog(this, "Testing...", new SwingWorkerInterface(){
                                    @Override
                                    public Object workToDo() throws Throwable {
                                            Thread.currentThread().sleep(3000);
                                            return null;
                    } catch (InterruptedException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                    } catch (ExecutionException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
             * Exits the program.
            public void exit(){
                    System.exit(0);
             * Create the GUI and show it. For thread safety, this method should be
             * invoked from the event-dispatching thread.
             * @throws UnsupportedLookAndFeelException
             * @throws IllegalAccessException
             * @throws InstantiationException
             * @throws ClassNotFoundException
             * @throws NullInstanceVariableException
             * @throws SQLException
            private static void createAndShowGUI() {
                    // set look and feel
                    try{
                            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                            // Create instance of the ProductCatalog
                            TestClass2 root = new TestClass2();
                            for(int i = 0; i < 10; i++){
                                    root.showWait();
                    }catch(Exception e){
                            e.printStackTrace();
             * @param args
             *            this program does not use arguments
            public static void main(String[] args) {
                    SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                    createAndShowGUI();
    }CLASS 2:
    import java.awt.Component;
    import java.awt.Frame;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.concurrent.ExecutionException;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import javax.swing.SwingWorker;
    public class WaitDialog extends JDialog {
            private boolean disposed = false;
            private boolean displayed = false;
            private WorkerThread worker = null;
            WaitDialog(Frame parent, String text, SwingWorkerInterface in){
                    super(parent, true);
                    worker = new WorkerThread(in);
                    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                    addWindowListener(new WindowAdapter() {
                            @Override
                            public void windowOpened(WindowEvent e) {
                                    worker.execute();
                            @Override
                            public void windowClosing(WindowEvent e) {
                                    disposeWaitDialog();
                    this.setResizable(false);
                    JLabel message = new JLabel();
                    message.setText(text);
                    JProgressBar pb = new JProgressBar();
                    pb.setIndeterminate(true);
                    // set size and location
                    setSize(200, 100);
                    setLocationRelativeTo(parent);
                    JPanel panel = new JPanel();
                    panel.add(message);
                    panel.add(pb);
                    add(panel);
            public void showWaitDialog(){
                    if(displayed == true){
                            return;
                    if(disposed == true){
                            disposed = false;
                            return;
                    disposed = false;
                    displayed = true;
                    setVisible(true);
            public void disposeWaitDialog(){
                    if(disposed == true){
                            return;
                    if(displayed == true){
                            displayed = false;
                            setVisible(false);
                            return;
                    disposed = true;
                    displayed = false;
            public static Object showWaitDialog(Component parent, String text, SwingWorkerInterface in) throws InterruptedException, ExecutionException {
                    WaitDialog waitDialog = null;
                    if (parent == null) {
                            waitDialog = new WaitDialog(JOptionPane.getRootFrame(), text, in);
                    } else {
                            waitDialog = new WaitDialog(JOptionPane.getFrameForComponent(parent), text, in);
                    while(!waitDialog.worker.isDone()){
                            System.out.println("about to show");
                            waitDialog.showWaitDialog();
                            System.out.println("done showing");
                    waitDialog.dispose();
                    return waitDialog.worker.get();
            class WorkerThread extends SwingWorker<Throwable, Void> {
                    private SwingWorkerInterface in = null;
                    WorkerThread(SwingWorkerInterface in){
                            this.in = in;
                    public Throwable doInBackground(){
                                    try {
                                            System.out.println("about to do work");
                                            in.workToDo();
                                            System.out.println("done work no exception");
                                    } catch (Throwable e) {
                                            System.out.println("done work with exception");
                                            return e;
                                    return null;
                    public void done(){
                                    System.out.println("about to dispose");
                                    disposeWaitDialog();
                                    System.out.println("disposed");
    }CLASS 3:
    public interface SwingWorkerInterface {
            public Object workToDo() throws Throwable;
    }

    There's nothing directly wrong with it, but it will
    prevent other threads acquiring the class lock - but
    that may be what you want.True. Although the typical case for code that looks like this would be to use wait--usually the various threads in question require the same lock, so you have to use wait in order for the waiting thread to give it up and allow the other thread to do its work. Hard to say for sure though what he's doing.
    Also, if loading is all that the other thread does, and you're waiting for that thread to die, use join. But then, if that's the case, and you're only waiting for a single other thread, then you might as well just put it all in one thread, as already indicated.

  • How do I assign a mouseclick event Listener to a simplebutton already nested in a movie clip when it's dropped on stage?

    I'm trying to assign a mouseclick event listener to a simplebutton nested within a movie clip's later frames, starting at frame 2 and up. This card, however, is not added to my game until later, and when the player clicks on it/turns it over.
    There are four files involved in this program:
    #1 The main actionscript file, which corresponds to
    #2 my dreamQuester .fla file.
    #3 my artifactCard file movieClip's corresponding .as file,
    #4 my combo1.as file corresponding to a an instance of a simpleButton named combo1 that is already
    nested --and this instance is already named-- inside/as a child of said artifactCard movieclip.
    What I've done so far isn't working:
    In my main dreamQuester.as file, when a player clicks on an artifactCard, its MOUSE_DOWN event
    listener takes them to this function (clickArtCard), where the trouble is at:
    // player clicked on the artC card--which is a child of posArt1 on stage--to turn card over:
            function clickArtCard(a_event:MouseEvent) {
                var thisArtCard:artifactCard = (a_event.target as artifactCard);
                thisArtCard.gotoAndStop(unclickedArt1);  // go to frame number of artifact
                                    // card where combo1 button is.
                thisArtCard.removeEventListener(MouseEvent.CLICK,clickArtCard);
                thisArtCard.buttonMode = false;
                trace("combo1.combo is:" + combo1.combo);
                trace("posArt1.artC.combo1 is:" + posArt1.artC.combo1);
                posArt1.artC.combo1.addEventListener(MouseEvent.MOUSE_DOWN, comboClickedWHO);
    when the artC card--the static public instance of artifactCard--is clicked, it only gets to the
    trace("posArt1.artC.combo1 is:" + posArt1.artC.combo1); which returns this error message:  
    TypeError: Error #1010: A term is undefined and has no properties.
        at MethodInfo-61()
    So do how would I declare a static public variable of this simpleButton at the start of my main .as
    file to make it defined to get a mouseDown actionListener into my pre-existing-and-named-instance
    combo1 simpleButton?
    perhaps there is a way, while the debug movie program is running, to click on the simpleButton and see exactly
    what it's parent heirarchy is, to see the name of all parents above the simpleButton incase they are
    different then what I think?
    (just in case, I was hoping to squeeze a zip file containing these files to be less than 9MB incase someone was willing to look at my files to see what I've done so far, but 9 megs is just too big! even though all graphics I've imported where turned into vector graphics with trace bitmap. I wish there was a way to check the file size of each symbol in Flash CS4, here...)
    Thank you so much for any help!
    ~Ethan

    Just use a
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
    function keyPressed(event:KeyboardEvent):void {
         //trace(event.keyCode);
         if(event.keyCode == ???){
              // play the sound
    Where I show the "???" you would replace with the keyCode for the key you want pressed for that sound.  To determine the keyCode you can use the trace line that I have commented out.
    Note that when testing in Flash you often need to disable the keyboard shortcuts in the Flash Player in order to be able to use alot of the keys.  You will find this option in the Control menu options in the player.

Maybe you are looking for

  • How can I get my purchases from iTunes on to a new Apple ID

    Hello I deleted my first email then I made a new one. I then deleted my old Apple ID since it was for my old email so I made a new one. I noticed that I can't see my iTunes purchases that I purchased I tried to sign into my old Apple ID but it has se

  • Looping at internal table

    Hi, I work on SAP BW and need guidance on the functionality from the below code: l_s_datapak_line[] = datapak[].     l_s_datapak[] = datapak[].     sort l_s_datapak_line by pernr endda descending. loop at l_s_datapak.    read table l_s_datapak_line w

  • I have coverage with mixed formats -  some with PAL ( we think 4:3 ratio) and some HD. When I chose

    I have coverage with mixed formats -  some with PAL ( we think 4:3 ratio) and some HD. When I chose our sequence settings to begin with, is there a way of preventing some shots with bars either at left and right or top and bottom?

  • Is it possible to center a checkbox in a table filter?

    Hi I am using Studio Edition Version 11.1.1.2.0. Is it possible to center a checkbox in a table filter without getting a bug? I have tried using a panelgroup with horizontal layout and Halign center. It looks good at first but when I use the filter t

  • Cisco NAC Authentication Server Order ??

    Hi all, 1_ Is there a way to specify an order for the authentication servers on NAC Manager v4.7.2 ?  what the customer needs is if the primary auth server (AD) fails than it fails over to Radius ? Is this possible ? 2_ Is there a way to map a role t