Best Practice: Executing the same code from different triggers

Swing supports the idea of Actions, which seems to be an implementation of the "Command" pattern. One can create an instance of an Action implementation and set it to several JComponents, like JButton and JMenuItem. Whenever the button or the menu item is triggered, the action gets executed. So far, so good.
But there are more triggers in Swing that cannot get configured to trigger an action, namely Drops and pressing the window's [X] Close icon. Certainly these fire events, but they do not automatically trigger actions.
Certainly one can react to importData(TransferSupport) and windowClosing() by manually calling the action's actionPerformed(ActionEvent) method, but as there is no setAction(Action) method at neither the TransferHandler class nor the WindowAdapter class, the question is: Where to take that Action instance from, and what command name to pass to it's constructor, and what to provide as the event source?
It just seems like the Action framework has a gap here, as it nicely covers these questions for JComponents, but not for JFrame and JDialog.
So unless there are JFrame.setDropAction(Action) and JFrame.setCloseAction(Action) methods added to the Swing framework (and I doubt they will get added any time near), my question is whether there have been establed some widely accepted best practices (i. e. something that 75% of the programmers will do, not something ONE programmer always does but just he does). Any Swing expert here answering this?

The window decorations are handled by the OS. That [X] close button isn't a JButton at all.
JFrame's and JDialog's, however, do have a root panes. And you can ask the root pane to take over window decorations via JFrame#setDefaultLookAndFeelDecorated(true). JDialog has a similar method. When the root pane takes over window decorations, then the [X] icon is a JButton and you could, in theory, set its action to an Action object.
The the metal LAF window decorations, however, are ugly (I think at least) and I'm not sure how many programs actually use it.

Similar Messages

  • The same code behaving different in two files.

    The same code behaving different in two files.
    in pro*c file it is returning rows
    in sql file it is not returning any rows.
    please suggest me.
    regards,
    prasad.

    please find the code.
    sql_stmt := 'SELECT rNum, dpcCode, sID, hDate, fBlock, '||
    'lBlock, recQty, fID, fName, ' ||
    'tSeqNo, sType, tDate, fStatCode, pDate, recCount, r ' ||
    'FROM (SELECT rownum rNum, DPC_CODE_ORIG dpcCode, ' ||
    'SENSOR_ID sID, ' ||
    'to_char(HEADER_DATE, ''YYYYMMDDHH24MISS'') hDate, ' ||
    'FIRST_BLOCK_NUMBER fBlock, ' ||
    'LAST_BLOCK_NUMBER lBlock, ' ||
    'RECORD_QUANTITY recQty, ' ||
    'FILE_ID fID, ' ||
    'substr(FILE_NAME,1,30) fName, ' ||
    'TRACE_SEQUENCE_NO tSeqNo, ' ||
    'SENSOR_TYPE sType, ' ||
    'to_char(TRAILER_DATE, ''YYYYMMDDHH24MISS'') tdate, ' ||
    'NVL(FILE_STATUS_CODE, ''NL'') fStatCode, ' ||
    'to_char(PROCESSED_DATE, ''YYYYMMDDHH24MISS'') pDate, '||
    'NVL(RECIRCULATE_COUNT,0) recCount, ' ||
    'ROW_NUMBER() ' ||
    'OVER(ORDER BY TRAILER_DATE DESC, LAST_BLOCK_NUMBER DESC) r ' ||
    'FROM logfc10t ' ||
    'WHERE DPC_CODE_ORIG = :IN_DPC_CODE ' ||
    'AND SENSOR_ID = :IN_SENSOR_ID ' ||
    'AND (((TRAILER_DATE <= TO_DATE(:IN_TRAILER_DATE, ''YYYYMMDDHH24MISS''))' ||
    ' AND (LAST_BLOCK_NUMBER < :IN_BLOCK_NUMBER)) ' ||
    ' OR (TRAILER_DATE < TO_DATE(:IN_TRAILER_DATE, ''YYYYMMDDHH24MISS'')))) ' ||
    'WHERE r = 1 ';

  • TS1382 I want to add multiples of the same song from different playlists to my ipod but iTunes wont let me. How can I override this so that I get the songs I want on my ipod?

    I want to add multiples of the same song from different playlists to my ipod but iTunes wont let me. How can I override this so that I get the songs I want on my ipod?

    You can sync those different playlists to the iPod, and the song appears on each playlist.  However, the song is stored on the iPod once.  What is the practical reason for wanting to store the same song file multiple times (and waste storage space) on the iPod?

  • Does anyone have experience with having multiple editors work on the same project from different computers?

    Does anyone have experience with having multiple editors work on the same project from different computers?

    As much as I hate to admit it, YOU ARE RIGHT!
    I will tread lightly on this project.
    Thanks for the sanity check,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to load the same classes of the same name, from different jars

    Hi,
    I have several different versions of my project in respective jars. I am trying to develop a configuration app, which will have the most current version of my app packaged within it. Then the user will make a selection, and if that selection is an older version, a specific class from one of the jars...which will continue to load other classes within that same jar. If it is the current version, the class will be found within the codebase.
    My question is if this is even possible? Can I load a class from a jar file which has the same file name and package as what is in my current code?

    nasch_,
    So I have been searchin around, and found some good tutorials on classloaders, But i still see a problem.
    Whether I use the same classloader for different sources or not, the problem lies within the reference to the class i am loading. Since this class (a different version of it), is also in the classpath, how does the code know which class is being returned?
    I am having trouble putting this into words, but basically. i don't see how my application will know that i am returning an instance of a class which is not in my classpath.

  • How do I call methods with the same name from different classes

    I have a user class which needs to make calls to methods with the same name but to ojects of a different type.
    My User class will create an object of type MyDAO or of type RemoteDAO.
    The RemoteDAO class is simply a wrapper class around a MyDAO object type to allow a MyDAO object to be accessed remotely. Note the interface MyInterface which MyDAO must implement cannot throw RemoteExceptions.
    Problem is I have ended up with 2 identical User classes which only differ in the type of object they make calls to, method names and functionality are identical.
    Is there any way I can get around this problem?
    Thanks ... J
    My classes are defined as followes
    interface MyInterface{
         //Does not and CANNOT declare to throw any exceptions
        public String sayHello();
    class MyDAO implements MyInterface{
       public String sayHello(){
              return ("Hello from DAO");
    interface RemoteDAO extends java.rmi.Remote{
         public String sayHello() throws java.rmi.RemoteException;
    class RemoteDAOImpl extends UnicastRemoteObject implements RemoteDAO{
         MyDAO dao = new MyDAO();
        public String sayHello() throws java.rmi.RemoteException{
              return dao.sayHello();
    class User{
       //MyDAO dao = new MyDAO();
       //OR
       RemoteDAO dao = new RemoteDAO();
       public void callDAO(){
              try{
              System.out.println( dao.sayHello() );
              catch( Exception e ){
    }

    >
    That's only a good idea if the semantics of sayHello
    as defined in MyInterface suggest that a
    RemoteException could occur. If not, then you're
    designing the interface to suit the way the
    implementing classes will be written, which smells.
    :-)But in practice you can't make a call which can be handled either remotely or locally without, at some point, dealing with the RemoteException.
    Therefore either RemoteException must be part of the interface or (an this is probably more satisfactory) you don't use the remote interface directly, but MyInterface is implemented by a wrapper class which deals with the exception.

  • Why does PSE 10 Organizer jumble up photos on the same date from different locations ?

    I have PSE 10 installed on a PC with Windows 7. My camera is a Nikon D90 using a Sandisk 8 gb SD card. When I take photos at different locations on the same date and download them into the Organizer , instead of keeping the photos from the different locations together by location, it jumbles them all up. It does not keep them in order by time taken from first to last for that day , it just mixes them all up in random order. Why ?

    Hi Lyndy,
    When you use Albums and Keyword Tags, you aren't moving the images around (they stay in their folders) - you just look at them differently.
    What you can try is this:-
    1) select one of your folders in folder view so that it displays all of those images in filename order
    2) click on the instant album button (to the top right of the thumbnails)
    This will generate an album with the same name as the folder
    3) Now switch to Thumbnail view
    4) click on the new albumb name on the right side
    Now, all the images should be in date/time order - you may have adjust the options
    The real power of the Keywrd Tags is the many different ways you can look at the images.
    If you have a Keyword Tag structure like this:-
    Places
         Scotland
                Holyrood
                Britania
    Then if you assign the Holyrood and britania tags to the appropiate photos, there are various ways of viewing the photos.
    Selecting just Holyrood would show only the Holyrood ones
    Selecting Scotland would show both Holyrood and Britania ones.
    The only limit seems to be your own imagination
    I hope that gives you ideas rather than adding confusion
    Brian

  • Can you change rollover text in the same slice for different triggers?

    Hi, I haven't used Fireworks since version 3, which was about 6 years ago, when I dabbled in web development.  My past has come back to haunt me, and I need to make a fairly simple website pretty quickly for my boss.  I've got myself CS4, and now that I've figured out that you can't use buttons for disjoint rollovers, I'm starting to make progress...
    What I want to achieve, is that there are 6 'buttons' on my page, which when you rollover them will display text in a box to the side.  I would use separate boxes for each button, but there isn't enough space on the page, as there is quite a lot of text, so I would like to use a box in the same place to display any of the 6 texts, depending on which button is rolled over.  Can this be done?
    I probably haven't quite got my head round layers, and this may be very simple, but could someone please point me in the right direction, even if it is a link to the right bit on product help?
    Because the button disjoint rollover doesn't work, I have created 6 slices for the triggers.  I tried hotspots first, but couldn't use them as I also want a rollover live filter effect on the trigger.

    Yes, you can trigger different slice contents on rollover from multiple other slices.
    It's easier to show than describe, so here is a sample file that does what I think you're looking for:
    (1) six buttons
    (2) each button has unique text
    (3) each button has a rollover state
    (4) unique text is displayed in the same place for each button on rollover
    Hope this helps!
    Dave
    Right-click and save the image below - it's a Fireworks source file:

  • Parallel run of the same function from multiple jobs

    Hello, everyone!
    I have a function which accepts a date range, reads invoices from a partitioned by date table and writes output to a partitioned by invoice table. Each invoice can have records only with one date, so both tables may have one invoice only in one partition, i.e. partitions do not overlap. Function commits after processing each date. The whole process was running about 6 hrs with 46 million records in source table.
    We are expecting source table to grow over 150 million rows, so we decided to split it into 3 parallel jobs and each job will process 1/3 of dates, and, as a result, 1/3 of invoices.
    So, we call this function from 3 concurrent UNIX jobs and each job passes its own range of dates.
    What we noticed, is that even if we run 3 jobs concurrently, they do not run this way! When 1st job ends after 2 hrs of run, the number of commited rows in the target table is equal to the number of rows inserted by this job. When 2nd job ends after 4 hrs of run, the number of rows in the target table is equal the summary of two jobs. And the 3rd job ends only after 6 hrs.
    So, instead of improving a process by splitting it into 3 parallel jobs we ended up having 3 jobs instead of one with the same 6 hrs until target table is loaded.
    My question is - How to make it work? It looks like Oracle 11g is smart enough to recognize, that all 3 jobs are calling the same function and execute this function only once at the time. I.e. it looks like only one copy of the function is loaded into the memory at the same even if it called by 3 different sessions.
    The function itself has a very complicated logic, does a lot of verifications by joining to another tables and we do not want to maintain 3 copies of the same code under different names. And beside this, the plan is that if with 150 mln rows we will have a performance problem, then split it to more concurrent jobs, for example 6 or 8 jobs. Obviously we do not want to maintain so many copies of the same code by copying this function into another names.
    I was monitoring jobs by quering V$SESSION and V$SQLAREA ROWS_PROCESSED and EXECUTIONS and I can see, that each job has its own set of SID's (i.e. runs up to 8 parallel processes), but number of commited rows is always eqal to the number of rows from the 1st job, then 2nd+1st, etc. So, it looks like all processes of 2nd and 3rd jobs are waiting until 1st one is done.
    Any ideas?

    OK, this is my SQL and results (some output columns are ommited as irrelevant)
    SELECT
            TRIM ( SESS.OSUSER )                                                        "OSUser"
          , TRIM ( SESS.USERNAME )                                                      "OraUser"
          , NVL(TRIM(SESS.SCHEMANAME),'------')                                         "Schema"
          , SESS.AUDSID                                                                 "AudSID"
          , SESS.SID                                                                    "SID"
          , TO_CHAR(SESS.LOGON_TIME,'HH24:MI:SS')                                       "Sess Strt"
          , SUBSTR(SQLAREA.FIRST_LOAD_TIME,12)                                          "Tran Strt"
          , NUMTODSINTERVAL((SYSDATE-TO_DATE(SQLAREA.FIRST_LOAD_TIME,'yyyy-mm-dd hh24:mi:ss')),'DAY') "Tran Time"
          , SQLAREA.EXECUTIONS                                                          "Execs"
          , TO_CHAR(SQLAREA.ROWS_PROCESSED,'999,999,999')                               "Rows"
          , TO_CHAR(TRAN.USED_UREC,'999,999,999')                                       "Undo Rec"
          , TO_CHAR(TRAN.USED_UBLK,'999,999,999')                                       "Undo Blks"
          , SQLAREA.SORTS                                                               "Sorts"
          , SQLAREA.FETCHES                                                             "Fetches"
          , SQLAREA.LOADS                                                               "Loads"
          , SQLAREA.PARSE_CALLS                                                         "Parse Calls"
          , TRIM ( SESS.PROGRAM )                                                       "Program"
          , SESS.SERIAL#                                                                "Serial#"
          , TRAN.STATUS                                                                 "Status" 
          , SESS.STATE                                                                  "State"
          , SESS.EVENT                                                                  "Event"
          , SESS.P1TEXT||' '||SESS.P1                                                   "P1"
          , SESS.P2TEXT||' '||SESS.P2                                                   "P2"
          , SESS.P3TEXT||' '||SESS.P3                                                   "P3"
          , SESS.WAIT_CLASS                                                             "Wait Class"
          , NUMTODSINTERVAL(SESS.WAIT_TIME_MICRO/1000000,'SECOND')                      "Wait Time"
          , NUMTODSINTERVAL(SQLAREA.CONCURRENCY_WAIT_TIME/1000000,'SECOND')             "Wait Concurr"
          , NUMTODSINTERVAL(SQLAREA.CLUSTER_WAIT_TIME/1000000,'SECOND')                 "Wait Cluster"
          , NUMTODSINTERVAL(SQLAREA.USER_IO_WAIT_TIME/1000000,'SECOND')                 "Wait I/O"
          , SESS.ROW_WAIT_FILE#                                                         "Row Wait File"
          , SESS.ROW_WAIT_OBJ#                                                          "Row Wait Obj"
          , SESS.USER#                                                                  "User#"
          , SESS.OWNERID                                                                "OwnerID"
          , SESS.SCHEMA#                                                                "Schema#"
          , TRIM ( SESS.PROCESS )                                                       "Process"
          , NUMTODSINTERVAL(SQLAREA.CPU_TIME/1000000,'SECOND')                          "CPU Time"
          , NUMTODSINTERVAL(SQLAREA.ELAPSED_TIME/1000000,'SECOND')                      "Elapsed Time"
          , SQLAREA.DISK_READS                                                          "Disk Reads"
          , SQLAREA.DIRECT_WRITES                                                       "Direct Writes"
          , SQLAREA.BUFFER_GETS                                                         "Buffers"
          , SQLAREA.SHARABLE_MEM                                                        "Sharable Memory"
          , SQLAREA.PERSISTENT_MEM                                                      "Persistent Memory"
          , SQLAREA.RUNTIME_MEM                                                         "RunTime Memory"
          , TRIM ( SESS.MACHINE )                                                       "Machine"
          , TRIM ( SESS.TERMINAL )                                                      "Terminal"
          , TRIM ( SESS.TYPE )                                                          "Type"
          , SQLAREA.MODULE                                                              "Module"
          , SESS.SERVICE_NAME                                                           "Service name"
    FROM    V$SESSION    SESS
    INNER JOIN V$SQLAREA    SQLAREA  
       ON SESS.SQL_ADDRESS  = SQLAREA.ADDRESS
       and UPPER(SESS.STATUS)  = 'ACTIVE'
    LEFT JOIN  V$TRANSACTION  TRAN
       ON  TRAN.ADDR         = SESS.TADDR
    ORDER BY SESS.OSUSER
            ,SESS.USERNAME
            ,SESS.AUDSID
            ,NVL(SESS.SCHEMANAME,' ')
            ,SESS.SID
    AudSID     SID     Sess Strt     Tran Strt     Tran Time     Execs     Rows     Undo Rec     Undo Blks     Sorts     Fetches     Loads     Parse Calls     Status     State     Event     P1     P2     P3     Wait Class     Wait Time     Wait Concurr     Wait Cluster     Wait I/O     Row Wait File     Row Wait Obj     Process     CPU Time     Elapsed Time     Disk Reads     Direct Writes     Buffers     Sharable Memory     Persistent Memory     RunTime Memory
    409585     272     22:15:36     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITED SHORT TIME     PX Deq: Execute Reply     sleeptime/senderid 200     passes 2     0     Idle     0 0:0:0.436000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     7     21777     22739     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     203     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.9674000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     25     124730     4180     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     210     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.11714000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     24     124730     22854     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     231     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.4623000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     46     21451     4178     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     243     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITED SHORT TIME     PX qref latch     function 154     sleeptime 13835058061074451432     qref 0     Other     0 0:0:0.4000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     35     21451     3550     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     252     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.19815000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     49     21451     22860     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     273     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.11621000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     22     124730     4182     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     277     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     db file parallel read     files 20     blocks 125     requests 125     User I/O     0 0:0:0.242651000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     39     21451     4184     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     283     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.2781000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     42     21451     3552     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     295     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.24424000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     40     21451     22862     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     311     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.15788000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     31     21451     22856     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     242     22:15:36     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITED KNOWN TIME     PX Deq: Execute Reply     sleeptime/senderid 200     passes 1     0     Idle     0 0:0:0.522344000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     28     137723     22736     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     192     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.14334000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     31     21462     4202     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     222     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.16694000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     37     21462     4194     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     233     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.7731000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     44     21462     4198     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     253     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     db file parallel read     files 21     blocks 125     requests 125     User I/O     0 0:0:0.792518000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     39     21462     4204     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     259     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.2961000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     35     21462     4196     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     291     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.9548000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     35     21462     4200     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     236     22:15:36     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq: Table Q Normal     sleeptime/senderid 200     passes 2     0     Idle     0 0:0:0.91548000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     25     124870     22831     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     207     22:30:30     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq: Execution Msg     sleeptime/senderid 268566527     passes 3     0     Idle     0 0:0:0.644662000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     43     21423     4208     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     241     22:30:30     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq: Execution Msg     sleeptime/senderid 268566527     passes 3     0     Idle     0 0:0:0.644594000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     47     21423     4192     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     297     22:30:30     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     db file parallel read     files 20     blocks 109     requests 109     User I/O     0 0:0:0.793261000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     12     21316     4206     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448Here I found one interesting query http://www.pythian.com/news/922/recent-spike-report-from-vactive_session_history-ash/
    But it does not help me

  • Best practice for a same query against 2 different tables

    Hello all,
    I want to extract info about tablespaces storage, both permanent and temporary. For that I use 2 different cursors that do exactly the same query but against a different table (dba_data_files and dba_temp_files).
    CURSOR permanentTBSStorageInfo (tablespaceName VARCHAR2) IS
    SELECT file_name, bytes, autoextensible, maxbytes, increment_by
    FROM dba_data_files
    WHERE tablespace_name = tablespaceName;
    CURSOR temporaryTBSStorageInfo (tablespaceName VARCHAR2) IS
    SELECT file_name, bytes, autoextensible, maxbytes, increment_by
    FROM dba_temp_files
    WHERE tablespace_name = tablespaceName;
    First I'm bothered that I have to use 2 cursors to execute the same query against 2 different tables. Is there no another way around?
    Then I fetch the results of this cursors in 2 different loops because I didn't find a way to dynamically call the cursors. I am looking for best practice here, knowing that I will do the same parsing against the results of the 2 cursors.
    Thank you,

    Hi
    Check whether the below query is helpful or not
    select      fs.tablespace_name "Tablespace",
         fs.tempspace "Temp MB",
         df.totalspace "Total MB"
         from
         (select
         tablespace_name,
         round(sum(bytes) / 1048576) TotalSpace
         from
         dba_data_files
         group by
         tablespace_name
         ) df,
         (select
         tablespace_name,
         round(sum(bytes) / 1048576) tempSpace
         from
         dba_temp_files
         group by
         tablespace_name
         ) fs
         where
         df.tablespace_name = fs.tablespace_name;
    Thanks

  • Drawing images gives 2 different results with the same code.

    Im adding my code on here, and its sort of long but ill try to explain it. Most of it you can ignore.
    Anyway i'm making a tree menu with only 1 level of expansion. So you have a TreeMenu object, and this object has some Branch classes. These Branch classes have Leaf classes. That is all. On the menu there is also a little box where you can click to expand and collapse each branch. if a branch is expanded, all of its leaves are shown. if it is collapsed only the branch name is shown.
    So far what I've described above works, there is a small scale compilable working program, that is alright. Theres just a few bugs to fix.
    A little feature of the tree is if a branch or a leaf is selected (has been clicked on in the past) it has a blue background. This sort of works. The branch names seem to work alright, and some of the leaves. However other if you run the example i provided you can click on Leaf 1, and it will be ok, but if you click on Leaf 2 then there blue background is twice as big as it should be. But for the rest, it works ok.
    This is weird to me because the same code handles any of these same situations. So it seems that i get 2 diferent results with the same code. If anyone would like to help heres some stuff you should know:
    You can ignore Leaf class, i dont think theres any errors in there.
    You can ignore just about all of Branch class except the update() method.
    You can ignore all of TreeMenu class except the inner MouseListener class might be useful.
    You can ignore TreeTester. Just the JFrame tester class.
    to run the code:
    javac TreeMenu.java
    java TreeMenu
    http://cs.ucsb.edu/~jsterling/treemenu.zip
    thanks.

    You make a good point Stefan but unfortunately I already checked that.  I have even copied the mapping (right click copy) and pasted it from the working Mapping to the bad Map (Paste) to make sure the context values were all the same.
    I also opened all the queues and compared the values in each.  All values match exactly except for the result(out) queue.
    In both tests I am using the same IDOC XML file. 
    These are the only differences I see.
    1.  The IDOC is exactly the same as far as I can tell but they come from two different source SWCV.  SAP APPL 4.7 and Steelcase_Procurement (ECC 6.0). 
    2.  The working map uses a local UDF.  The bad map calls the UDF from a Function Group.  Is there a Java version difference between the two?
    A better sample of the result queues look like this:
    Correct Result:
    Thickness of Glass: 20
    Height: 10
    Width: 5
    Length: 18
    Thickness of Glass: 10
    Height: 15
    Width: 8
    Length: 14
    Bad Result:
    Thickness of Glass: 20
    <null>
    <null>
    <null>
    Width: 5
    <null>
    <null>
    <null>
    I took this chance to redesign my Variant Config output to separate the characteristics/values, but I'm still bothered that I was unable to determine what would cause the differing values.
    Any ideas?
    Thanks,
    Matt

  • Why differences in the way different machines handle the same code??

    OK, I've posted some other threads re some difficulties in getting the same code to function identically on, not only different platforms, but even on different machines running Windows!
    Here's another, and I would really appreciate an explanation:
    I have a tree control. Per the user's request, I made the right button function the same way it does on MS File Explorer: When they right click, the currently selected nodes are compared to the node they clicked over. If they clicked over a selected node, then the context menu for the nodes selected is displayed. If they clicked over a different node, then the selection is changed to the new node and the context menu displayed. If they right click over the tree control, but not a node in the tree, then the selection is cleared and no context menu is displayed.
    Works great on my machine.
    However, on some machines, no context menu is displayed, nor is the node selected... UNLESS THEY ALREADY HAVE A NODE SELECTED. I.e., if they have no nodes in the tree selected, they cannot display the context menu by right clicking on a node, nor does the selection change to the node they right click over. It only works if they already have something selected.
    My app is distributed as an executable jar file and I am distributing the JRE with it, so there are no class path issues or differences in the JDK. Basically, my problem can be paraphrased as: Why doesnt' Swing behave the same way on different machines...? At least why not the same on the eame machine.
    It's driving me nuts to think that I've resolved some UI glitch only to find out that, no, it's only fixed on some machines, not others.
    Thanks.

    Well, I normally develop on OSX and then deploy to Windows. But, this last build I have switched to Windows XP. The kinds of differences I am seeing are subtle: what triggers a repaint of the UI and now, it seems, what events are getting triggered by mouse clicks.
    My deployment is an executable jar file, therefore it uses the manifest in the jar, not any classpath variables. I deploy an entire JRE along with the app, and the bat file that launches the app ensures that is the JAVA_HOME I'm using.
    I can only guess that it's some underlying difference in versions of the platform and OS that causes this.
    Here's the entire code for this latest issue re the popups:
            private void maybeShowPopup(NodeInfoTree tree, MouseEvent e) {
                if (e.isPopupTrigger()) {
                    //  They clicked the platform dependent popup trigger...
                    int x = e.getX();
                    int y = e.getY();
                    TreePath[] selectedPaths = tree.getSelectionPaths();
                    if (selectedPaths == null) {
                        selectedPaths = new TreePath[0];
                    TreePath clickedPath = tree.getPathForLocation(x,y);
                    if (clickedPath == null) {
                        //  they right clicked, but not on a node, so clear the selection and return
                        tree.clearSelection();
                        return;
                    } else {
                        // They clicked on a path, so let's see if it is a selected
                        // node.  Search the selected array of paths, short circuiting
                        // out if it is found...
                        boolean foundInSelection = false;
                        for (int i=0; (!foundInSelection && (i < selectedPaths.length)); i++) {
                            foundInSelection = clickedPath.equals(selectedPaths);
    if (!foundInSelection) {
    // They right clicked elsewhere than the selection, so
    // reset the selection to the new path...
    tree.setSelectionPath(clickedPath);
    final TreePath menuPath;
    selectedPaths = tree.getSelectionPaths();
    if (selectedPaths == null) {
    return;
    } else {
    menuPath = selectedPaths[selectedPaths.length-1];
    // Since they did click on a node, now we need to determine
    // what popup menu should be displayed...
    tree.scrollPathToVisible(menuPath);
    NodeInfo ni = (NodeInfo) menuPath.getLastPathComponent();
    // If the last path component is null, then they don't have
    // anything selected, so we do nothing
    if (ni == null) return;
    // See if the Node is overriding our default popup menu...
    com.harcourt.applications.tgen.browser.nodes.NodeMenu nodeMenu = ni.getMenu();
    nodeMenu.activate(tree.getView(),ni);
    JPopupMenu popup = (JPopupMenu) nodeMenu;
    if (popup != null) {
    popup.show(e.getComponent(),
    e.getX(), e.getY());
    The nodeMenu.activate call is just used to check whether or not certain menu options need to be enabled or disabled before displaying the menu. My theory right now is that, on some of these machines (all windows), a right click of the mouse is not generating a mouse event unless they have already something selected. I don't think it's a focus issue, because if they left click to select a node, and then ctrl-left click to de-select it, the right button then no longer generates a popup menu. They must select a node, then right click. Maybe there's no mouse event generated, or maybe this line is failing on some machines?:
    TreePath clickedPath = tree.getPathForLocation(x,y);

  • I downloaded pages from the app store and I can use it on my Mac login but it doesn't show up when my wife logs in to her account? Were using the same computer, just different logins.

    I downloaded pages from the app store and I can use it on my Mac login but it doesn't show up when my wife logs in to her account? Were using the same computer, just different logins.

    No. You need to buy it for your Apple ID and for the other. You will have problems with updates

  • Can I use one Apple TV device on two different HD televisions to view the same info from a mini Mac?

    Can I use one Apple TV device on two different HD televisions to view the same info from a mini Mac?

    Welcome to the Apple Community Lschaef5318.
    You need one Apple TV for each TV.

  • I would like to transfer music from my account to my wife`s on the same Mac but different users, i want her to have her own i tunes account but now that she has downloaded all of her stuff in my account , she has to "erase and sync"  how can i troublshoot

    I would like to transfer music from my account to my wife`s on the same Mac but different 2 users (hers and mine), i want her to have her own i tunes account but now that she has downloaded all of her stuff in my account , she has to "erase and sync" all of her stuff when she opens her account which has nothing in it!, how can i send stuff from my i tunes account to hers? same computer different users, how can i trouble shoot please help!!??

    how do i share then? can she upload music if we share it somehow?
    If so how??
    i am also having the same problems now with IPhoto, she has all of her/our pics in my IPhoto library.
    I have told her that now i have bought her the Ipad she would have to log into her user, the only thing is there is no music in her itunes account nor photos in her I Photo library, i have spent all day trying to find a way to "share" but no luck,
    Please help i`m going mad!
    Surely we could just share these...?
    I need step by step instructions please someone send me a link on "how to share pics and music!"

Maybe you are looking for

  • Micro SD / transflash probems

    I haven't been able to connect my new MacBook to my Nokia phone or its card alone (using external card reader). When I try to mount the card, nothing happens. If I open "/Volumes", though, there's the name of my card, and shows as read-only. Inside i

  • Remove Publish my free/busy information option

    Is there a way to remove the "Publish my free/busy information" option from the options page in webaccess ? Using Webaccess 802HP1 /Tobias

  • IE Pluggin question ... problem or not?

    In my employment we utilize a pre-packaged product that we can and sometimes do customize to our needs, as well as add additions to. This package is available in both traditional client/server and thin-client (web-browser) server form. At this time,

  • How can i switch back to iOS 7.1 since i am not happy with iOS 8?

    MY iphone never hanged before updating to iOS 8. While using camera i cant switch to different modes i.e. From photo to video or panaroma mode. Also from control centre the torch light option cant be used. Safari became too slow to access. Had issues

  • Drop one datafile from Tablespace

    Hi, I have 9i Database on Linux. I want to drop one datafile from tablespace. I have tried to drop datafile through following command but it gave no effect. alter database datafile <datafile name> offline drop; What should i have to do for dropping d