When to use collection?

Sorry to post such question in this forum , but i would like to recieve some interesting about this .
I know the basics of collection but i dnt know when to use which one?
I am totally confused that all are working for the same thing with little difference .
Please suggest me some tutorial if do u have .
Thanks in advance .
Hope u will realize my problem.

I am totally confused that all are working for the same thing with little difference .Ahh - but those little differences can be important.
Basic rules
1 - First decide if you need a List, Map or Set.
2 - If it is List, probably use ArrayList
3 - If it is a Map, probably use HashMap
4 - For a Set, probably use HashSet.
That covers 90% of the base cases. Most of the time you just need those base classes.
As always there are the exceptions
- If you are constantly reading/adding/removing from the ends of the list, and not accessing the middle, consider using LinkedList implementation.
- If you want your Map to be ordered by key (like a dictionary for example), then TreeMap
- If you want your Map to retain the order they were inserted, then LinkedHashMap
Yes the differences are subtle between versions, but those subtleties can be important.
However in most cases, you can just use the stock standard base class.

Similar Messages

  • When I first started using Collections, I followed someone's advice and always clicked 'create virtu

    When I first started using Collections, I followed someone's advice and always clicked 'create virtual copy' -- so I now have a huge number of unused/useless VCs that I would like to clear out. Is there any way to 1) filter to show all virtual copies that have not been changed (but keep the ones that I have edited or changed in any way, 2) delete the unchanged virtual copies but keep the collection that holds them intact? I can picture a work-around for the second part by color coding all the unused VCs along with their original, deleting the unedited VCs, going to the folder and selecting all the colored originals, dragging them to the colection and then removing the color lable. Cumbersome, but doable.

    Umm no not that i remember. It just randomly started happening. I reformatted the hard drive for mac (journaled) but it was working fine since i did it until now

  • Occasionally,  some of the image borders turn dark grey (medium grey is the default) and then random other  images cannot be opened with a double click.  They only open when selected using the arrows on the keyboard.  They also cannot be moved to collecti

    Occasionally,  some of the image borders turn dark grey (medium grey is the default) and then random other  images cannot be opened with a double click.  They only open when selected using the arrows on the keyboard.  They also cannot be moved to collections.  Anyone have a solution for this?

    When you say  "could not be opened"- what are you referring to?  A double click of the mouse should view the clicked image in Loupe view- the same as pressing [E] on the keyboard for an enlarged view. (And a second double-click will take you back to library grid view.)
    To "open" an image in the Development module requires you to select the image then press [D] or click on the [Develop] button.
    When you say "could not be ...moved" -what are you referring to?  Are you trying to move an image file from its place in a folder to another folder? Are you just wanting it in a collection? When you drag an image to a collection you are only placing a link to the image in the collection- not actually moving any file. The image will stay exactly where it is in its original folder and will remain as a thumbnail preview in the Library Grid view.
    Are you having any "mouse" problems that may be changing its actions in LR ?
    Do you see an exclamation mark on any image borders ?
    Let's keep working on this. I am curious to see you find an answer.
    Rob

  • Commit / Rollback  AND  ERROS when to use BULK COLLECT

    Hi
    Where can I to put commit when to use bulk collect for to insert or update ?,
    How many records I to must to commit ?
    declare
    TYPE t_cd_estrutura_comercial IS TABLE OF t_ec_pessoa_perfil_ciclo.cd_estrutura_comercial%TYPE   INDEX BY PLS_INTEGER;
    TYPE t_cd_tipo_estrutura_comercial IS TABLE OF t_ec_pessoa_perfil_ciclo.cd_tipo_estrutura_comercial%TYPE  INDEX BY PLS_INTEGER;
    TYPE t_nm_ciclo_operacional IS TABLE OF  t_ec_pessoa_perfil_ciclo.nm_ciclo_operacional%TYPE   INDEX BY PLS_INTEGER;
    TYPE t_cd_consultora IS TABLE OF t_ec_pessoa_perfil_ciclo.cd_consultora%TYPE  INDEX BY PLS_INTEGER;
    TYPE t_cd_perfil IS TABLE OF t_ec_pessoa_perfil_ciclo.cd_perfil%TYPE  INDEX BY PLS_INTEGER;
    TYPE t_cd_indicador IS TABLE OF t_ec_pessoa_perfil_ciclo.cd_indicador%TYPE  INDEX BY PLS_INTEGER;
    TYPE t_vl_indicador IS TABLE OF t_ec_pessoa_perfil_ciclo.vl_indicador%TYPE  INDEX BY PLS_INTEGER;
    TYPE t_dt_ultima_atualizacao IS TABLE OF t_ec_pessoa_perfil_ciclo.dt_ultima_atualizacao%TYPE   INDEX BY PLS_INTEGER;
    v_cd_estrutura_comercial t_cd_estrutura_comercial;
    v_cd_tipo_estrutura_comercial t_cd_tipo_estrutura_comercial;
    v_nm_ciclo_operacional t_nm_ciclo_operacional;
    v_cd_consultora t_cd_consultora;
    v_cd_perfil t_cd_perfil;
    v_cd_indicador t_cd_indicador;
    v_vl_indicador t_vl_indicador;
    v_dt_ultima_atualizacao t_dt_ultima_atualizacao;
    V_CURSOR  SYS_REFCURSOR;
    n  pls_integer :=0;
    begin
      ---open v_cursor 
      pkg_scnob_batch_indicadores.abre_cursor(275,v_cursor);
       LOOP
       FETCH V_CURSOR   BULK COLLECT INTO
         v_cd_estrutura_comercial,
         v_cd_tipo_estrutura_comercial,
         v_nm_ciclo_operacional,
         v_cd_consultora,
         v_cd_perfil,
         v_cd_indicador,
         v_vl_indicador,
         v_dt_ultima_atualizacao  LIMIT 1000;
           FORALL i IN 1 .. v_cd_estrutura_comercial.COUNT
              MERGE
                 INTO T_EC_PESSOA_PERFIL_CICLO tgt
                 USING ( SELECT v_cd_estrutura_comercial(i) cd_estrutura_comercial,                           
                          v_cd_tipo_estrutura_comercial(i) cd_tipo_estrutura_comercial,                      
                         v_nm_ciclo_operacional(i) nm_ciclo_operacional,                             
                         v_cd_consultora(i) cd_consultora,                                    
                         v_cd_perfil(i)    cd_perfil,                                       
                         v_cd_indicador(i) cd_indicador,                                     
                         v_vl_indicador(i) vl_indicador,                                     
                         v_dt_ultima_atualizacao(i) dt_ultima_atualizacao FROM  dual ) src
                 ON   (   src.CD_ESTRUTURA_COMERCIAL            = TGT.CD_ESTRUTURA_COMERCIAL        
                          AND src.CD_TIPO_ESTRUTURA_COMERCIAL   = TGT.CD_TIPO_ESTRUTURA_COMERCIAL   
                          AND src.NM_CICLO_OPERACIONAL          = TGT.NM_CICLO_OPERACIONAL          
                          AND src.CD_CONSULTORA                 = TGT.CD_CONSULTORA                 
                          AND src.CD_PERFIL                     = TGT.CD_PERFIL                     
                          AND  src.CD_INDICADOR                 = TGT.CD_INDICADOR  )
              WHEN MATCHED
              THEN
                UPDATE
                 SET TGT.VL_INDICADOR  = src.VL_INDICADOR ,                             
                     TGT.DT_ULTIMA_ATUALIZACAO  = src.DT_ULTIMA_ATUALIZACAO                     
              WHEN NOT MATCHED
              THEN
                 INSERT (tgt.CD_ESTRUTURA_COMERCIAL,                           
                         tgt.CD_TIPO_ESTRUTURA_COMERCIAL,                      
                         tgt.NM_CICLO_OPERACIONAL,                             
                         tgt.CD_CONSULTORA,                                    
                         tgt.CD_PERFIL ,                                       
                         tgt.CD_INDICADOR,                                     
                         tgt.VL_INDICADOR,                                     
                         tgt.DT_ULTIMA_ATUALIZACAO)                            
                 VALUES (src.CD_ESTRUTURA_COMERCIAL,                           
                         src.CD_TIPO_ESTRUTURA_COMERCIAL,                      
                         src.NM_CICLO_OPERACIONAL,                             
                         src.CD_CONSULTORA,                                    
                         src.CD_PERFIL ,                                       
                         src.CD_INDICADOR,                                     
                         src.VL_INDICADOR,                                     
                         src.DT_ULTIMA_ATUALIZACAO) ;
               -- Did I to must commit here ?     
               --         commit;
           n := n + SQL%ROWCOUNT;
        EXIT WHEN  V_CURSOR%NOTFOUND; 
      END LOOP; 
    exception
       when others then
           rollback;  -- and log errors
    end;

    There is a lot of questions like this
    Actually there no precise max of records to be committed
    The COMMIT

  • Best practices when using collections in LR 2

    How are you using collections and collection sets? I realize that each photographer uses them differently, but I'm looking some inspiration because I have used them only very little.
    In LR 1 I used collections a bit like virtual Folders, but it doesn't anymore work as naturally in LR2.
    In LR 1 it was like:
    Travel (1000 images, all Berlin images)
    Travel / Berlin trip (400 images, all Berlin trip images)
    Travel / Berlin trip / web (200 images)
    Travel / Berlin trip / print (100 images)
    In LR 2 it could be done like this, but this somehow feels unnatural.
    Travel (Collection Set)
    Travel / Berlin trip (CS)
    Travel / Berlin trip / All (collection, 400 images)
    Travel / Berlin trip / web (collection, 200 images)
    Travel / Berlin trip / print (collection, 100 images)
    Or is this kind of use stupid, because same could be done with keywords and smart collections, and it would be more transferable.
    Also, how heavily are you using Collections? I'm kind of on the edge now (should I start using them heavily or not), because I just lost all my collections because I had to build my library from scratch because of weird library/database problems.

    Basically, i suggest not to use collections to replicate the physical folder structure, but rather to collect images independent of physical storage to serve a particular purpose. The folder structure is already available as a selection means.
    Collections are used to keep a user defined selection of images as a persistent collection, that can be easily accessed.
    Smart collections are based on criteria that are understood by the application and automatically kept up to date, again as a persistent collection for easy access. If this is based on a simple criterium, this can also, and perhaps even easier, done by use of keywords. If however it is a set of criteria with AND, OR combinations, or includes any other metadata field, the smart collection is the better way to do it. So keywords and collections in Lightroom are complementary to eachother.
    I use (smart)collections extensively, check my website  www.fromklicktokick.com where i have published a paper and an essay on the use of (smart)collections to add controls to the workflow.
    Jan R.

  • When should i use Collection?

    If i can use Arrays of Object (of course, arrays of the same kind of object), i guess there arent any advantage in using Collection? iam right?
    Regards again, Euclides.

    If i can use Arrays of Object (of course, arrays of
    the same kind of object), i guess there arent any
    advantage in using Collection? iam right?
    Regards again, Euclides.There are definate advantages to using Collections, depending upon the situation. Check out the introduction of the Collections tutorial provided by Sun:
    http://java.sun.com/docs/books/tutorial/collections/index.html

  • Database, Dataset, Table Adaptors Error "Unable to load, Update requires a valid DeleteCommand when passed DataRow collection with deleted row"

    Microsoft Visual Basic 2010 Express.
    I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
    when passed DataRow collection with deleted rows". 
    I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
    the previous uploads and all the rows that i wanted to delete are still there.
    My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller.  IF the customer
    needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.  
    Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    CODE:
    Private Function LoadOffSetData()
            Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
            LoadOffsetDialog.DefaultExt = "csv"
            LoadOffsetDialog.Filter = "csv|*.csv"
            LoadOffsetDialog.Title = "Load Offset Data"
            LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
            If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then  'show the dialog and if the result is ok then
                Try
                    Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
                    If (myStream IsNot Nothing) Then 'if the file is valid
                        For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
                            oldRow.Delete()                       
    'delete all of the existing rows
                        Next
                        'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        Dim rowvalue As String
                        Dim cellvalue(25) As String
                        'Reading CSV file content
                        While myStream.Peek() <> -1
                            Dim NRow As MaterionOffsetDataSet.OffsetTableRow
                            rowvalue = myStream.ReadLine()
                            cellvalue = rowvalue.Split(","c) 'check what is ur separator
                            NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
                            Me.OffsetTableTableAdapter.Update(NRow)
                        End While
                        Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue          'saves all the table offsets
    to the offset numericUpDown registers in the main window
                        StationOffset01.Value = OffsetTableTableAdapter.Station01Value
                        StationOffset02.Value = OffsetTableTableAdapter.Station02Value
                       myStream.Close() 'close the stream
                        Return True
                    Else 'if we were not able to open the file then
                        MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
                        Return False
                    End If
                Catch ex As Exception
                    MsgBox("Unable to load, " + ex.Message)
                    Return False
                End Try
            Else
                Return False
            End If
        End Function

    Hello SaulMTZ,
    >>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    This error usually shows that you do not initialize the
    DeleteCommand object, you could check this
    article to see if you get a workaround.
    >> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
    http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
    which seems to be easier (in my opinion).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Applet failed to load when visited using HTTPs protocol with Java 7

    We have a java applet on our website which worked for ages. Then Java 7 came out, people installed it. When people with Java 7 visiting our website using HTTPS, the applet failed to load (ClassNotFoundException). The same site and the same applet, when visit using regular HTTP, it works fine.
    People with previous version of Java (1.6.x) can see the applet using either HTTP or HTTPs with no problem.
    Anything we can do on our side to resolve this problem for people with Java 7 and like to stay with HTTPS?
    Googled and didn't see any relevant result. Any pointer would be much appreciated.

    Thanks for the quick response.
    Not much on the stack trace, did a tread dump below.
    It is an application requires login, please sent and email to [email protected] and I will sent you the url and login info by email.
    Thanks
    plugin2manager.parentwindowDispose
    Java Plug-in 10.4.0.22
    Using JRE version 1.7.0_04-b22 Java HotSpot(TM) Client VM
    User home directory = C:\Users\dchen
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    Dump thread stack ...
    2012-05-10 17:17:59
    Full thread dump Java HotSpot(TM) Client VM (23.0-b21 mixed mode, sharing):
    "D3D Screen Updater" daemon prio=8 tid=0x04fa1800 nid=0x530 in Object.wait() [0x0a0df000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at sun.java2d.d3d.D3DScreenUpdateManager.run(Unknown Source)
         - locked <0x296c0248> (a java.lang.Object)
         at java.lang.Thread.run(Unknown Source)
    "ConsoleTraceListener" daemon prio=4 tid=0x04fa0000 nid=0x269c in Object.wait() [0x09c8f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:503)
         at com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$ConsoleWriterThread.run(Unknown Source)
         - locked <0x296c0c90> (a com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$BoundedStringBuffer)
    "AWT-EventQueue-1" prio=6 tid=0x04fa2000 nid=0x1730 waiting on condition [0x0a6ce000]
    java.lang.Thread.State: RUNNABLE
         at com.sun.deploy.uitoolkit.ui.ConsoleHelper.dumpAllStacksImpl(Native Method)
         at com.sun.deploy.uitoolkit.ui.ConsoleHelper.dumpAllStacks(Unknown Source)
         at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow$2.actionPerformed(Unknown Source)
         at javax.swing.JComponent$ActionStandin.actionPerformed(Unknown Source)
         at javax.swing.SwingUtilities.notifyAction(Unknown Source)
         at javax.swing.JComponent.processKeyBinding(Unknown Source)
         at javax.swing.KeyboardManager.fireBinding(Unknown Source)
         at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
         at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
         at javax.swing.JComponent.processKeyBindings(Unknown Source)
         at javax.swing.JComponent.processKeyEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$000(Unknown Source)
         at java.awt.EventQueue$3.run(Unknown Source)
         at java.awt.EventQueue$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue$4.run(Unknown Source)
         at java.awt.EventQueue$4.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    "TimerQueue" daemon prio=4 tid=0x04f9e000 nid=0x3e0c waiting on condition [0x09f3f000]
    java.lang.Thread.State: WAITING (parking)
         at sun.misc.Unsafe.park(Native Method)
         - parking to wait for <0x24620900> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
         at java.util.concurrent.locks.LockSupport.park(Unknown Source)
         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
         at java.util.concurrent.DelayQueue.take(Unknown Source)
         at javax.swing.TimerQueue.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    "AWT-EventQueue-4" prio=4 tid=0x04fa1400 nid=0x255c waiting on condition [0x0945f000]
    java.lang.Thread.State: WAITING (parking)
         at sun.misc.Unsafe.park(Native Method)
         - parking to wait for <0x246209e8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
         at java.util.concurrent.locks.LockSupport.park(Unknown Source)
         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
         at java.awt.EventQueue.getNextEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    "Applet 5 LiveConnect Worker Thread" prio=4 tid=0x04f9f400 nid=0x3994 in Object.wait() [0x05d9f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:503)
         at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
         - locked <0x24620ac8> (a java.lang.Object)
         at java.lang.Thread.run(Unknown Source)
    "AWT-EventQueue-0" prio=6 tid=0x04f9fc00 nid=0x3b2c waiting on condition [0x0608f000]
    java.lang.Thread.State: WAITING (parking)
         at sun.misc.Unsafe.park(Native Method)
         - parking to wait for <0x2979ab70> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
         at java.util.concurrent.locks.LockSupport.park(Unknown Source)
         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
         at java.awt.EventQueue.getNextEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    "AWT-Shutdown" prio=6 tid=0x04f9e800 nid=0x244c in Object.wait() [0x0669f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:503)
         at sun.awt.AWTAutoShutdown.run(Unknown Source)
         - locked <0x2979acd8> (a java.lang.Object)
         at java.lang.Thread.run(Unknown Source)
    "TimerQueue" daemon prio=6 tid=0x04fa0c00 nid=0x3914 waiting on condition [0x0a65f000]
    java.lang.Thread.State: WAITING (parking)
         at sun.misc.Unsafe.park(Native Method)
         - parking to wait for <0x29c27340> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
         at java.util.concurrent.locks.LockSupport.park(Unknown Source)
         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
         at java.util.concurrent.DelayQueue.take(Unknown Source)
         at javax.swing.TimerQueue.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    "JVM[id=2]-Heartbeat" daemon prio=6 tid=0x04f9ec00 nid=0x3c98 in Object.wait() [0x0687f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at sun.plugin2.main.server.HeartbeatThread.run(Unknown Source)
         - locked <0x2979a7a0> (a sun.plugin2.main.client.PluginMain$Heartbeat)
    "Browser Side Object Cleanup Thread" prio=6 tid=0x04f9d000 nid=0x3ce4 in Object.wait() [0x0710f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x2979a958> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         - locked <0x2979a958> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         at sun.plugin2.main.client.LiveConnectSupport$BrowserSideObjectCleanupThread.run(Unknown Source)
    "CacheCleanUpThread" daemon prio=6 tid=0x04f9dc00 nid=0x2500 in Object.wait() [0x0655f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x2979a978> (a com.sun.deploy.cache.CleanupThread)
         at java.lang.Object.wait(Object.java:503)
         at com.sun.deploy.cache.CleanupThread.run(Unknown Source)
         - locked <0x2979a978> (a com.sun.deploy.cache.CleanupThread)
    "CacheMemoryCleanUpThread" daemon prio=6 tid=0x04f9d400 nid=0x1ac4 in Object.wait() [0x0611f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x2979aa68> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         - locked <0x2979aa68> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         at com.sun.deploy.cache.MemoryCache$LoadedResourceCleanupThread.run(Unknown Source)
    "SysExecutionTheadCreator" daemon prio=6 tid=0x04f9c800 nid=0x3ff4 in Object.wait() [0x0660f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:503)
         at sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator.run(Unknown Source)
         - locked <0x2979aa88> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
    "AWT-Windows" daemon prio=6 tid=0x04f8f000 nid=0x3480 runnable [0x026af000]
    java.lang.Thread.State: RUNNABLE
         at sun.awt.windows.WToolkit.eventLoop(Native Method)
         at sun.awt.windows.WToolkit.run(Unknown Source)
    "Java2D Disposer" daemon prio=10 tid=0x04f8d000 nid=0x1920 in Object.wait() [0x064ff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         - locked <0x2979ad68> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         at sun.java2d.Disposer.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    "Java Plug-In Pipe Worker Thread (Client-Side)" daemon prio=6 tid=0x04f8a000 nid=0x580 runnable [0x0617f000]
    java.lang.Thread.State: RUNNABLE
         at sun.plugin2.os.windows.Windows.ReadFile0(Native Method)
         at sun.plugin2.os.windows.Windows.ReadFile(Unknown Source)
         at sun.plugin2.ipc.windows.WindowsNamedPipe.read(Unknown Source)
         at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.read(Unknown Source)
         at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.readByte(Unknown Source)
         at sun.plugin2.message.AbstractSerializer.readInt(Unknown Source)
         at sun.plugin2.message.transport.SerializingTransport.read(Unknown Source)
         at sun.plugin2.message.Pipe$WorkerThread.run(Unknown Source)
    "Timer-0" prio=6 tid=0x04f3d800 nid=0x2c38 in Object.wait() [0x0521f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x2979b0a8> (a java.util.TaskQueue)
         at java.lang.Object.wait(Object.java:503)
         at java.util.TimerThread.mainLoop(Unknown Source)
         - locked <0x2979b0a8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Unknown Source)
    "traceMsgQueueThread" daemon prio=6 tid=0x04f19c00 nid=0x3b50 in Object.wait() [0x054cf000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:503)
         at com.sun.deploy.trace.Trace$TraceMsgQueueChecker.run(Unknown Source)
         - locked <0x298209e0> (a java.util.ArrayList)
         at java.lang.Thread.run(Unknown Source)
    "Service Thread" daemon prio=6 tid=0x04e80c00 nid=0x2930 runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "C1 CompilerThread0" daemon prio=10 tid=0x04e7c400 nid=0x2648 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "Attach Listener" daemon prio=10 tid=0x04e7b000 nid=0x1b5c runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "Signal Dispatcher" daemon prio=10 tid=0x04e77c00 nid=0x1bd0 runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "Finalizer" daemon prio=8 tid=0x022e1000 nid=0x3d00 in Object.wait() [0x04c5f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         - locked <0x2979b330> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(Unknown Source)
         at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
    "Reference Handler" daemon prio=10 tid=0x022df800 nid=0x3644 in Object.wait() [0x04bdf000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:503)
         at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
         - locked <0x2979a0c8> (a java.lang.ref.Reference$Lock)
    "main" prio=6 tid=0x0036d800 nid=0x2f40 in Object.wait() [0x00a2f000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
         - locked <0x2979b3b8> (a sun.plugin2.message.Queue)
         at sun.plugin2.message.Pipe$1.run(Unknown Source)
         at com.sun.deploy.util.Waiter$1.wait(Unknown Source)
         at com.sun.deploy.util.Waiter.runAndWait(Unknown Source)
         at sun.plugin2.message.Pipe.receive(Unknown Source)
         at sun.plugin2.main.client.PluginMain.mainLoop(Unknown Source)
         at sun.plugin2.main.client.PluginMain.run(Unknown Source)
         at sun.plugin2.main.client.PluginMain.main(Unknown Source)
    "VM Thread" prio=10 tid=0x022de400 nid=0x3cc0 runnable
    "VM Periodic Task Thread" prio=10 tid=0x04ea9000 nid=0x3fd4 waiting on condition
    .main.client.PluginMain.run(Unknown Source)
         at sun.plugin2.main.client.PluginMain.main(Unknown Source)
    "VM Thread" prio=10 tid=0x022de400 nid=0x3cc0 runnable
    "VM Periodic Task Thread" prio=10 tid=0x04ea9000 nid=0x3fd4 waiting on condition
    Done.

  • How to create a Pooled VDI infrastructure using Win server 2012 as VM image?I have followed the "usual" way to build a pooled VDI desktop using Win7 or Win8 with success, but it fails when I use an image of Win Server 2012 as VM

    I have followed the "usual" way to build a pooled VDI desktop using Win7 or Win8 with success, but it fails when I use an image of Win Server 2012 as VM instead.
    Am I overlooking something?  Should I need to prepare the image in a different way? (Sysprep differently?)
    Thanks

    Hi,
    Thank you for your posting in Windows Server Forum.
    Can you specify the error which you are facing during VDI setup for server 2012?
    I might think that you need to check the memory setting for server 2012, as might happens that due to less memory you can’t setup the VDI setup properly. 
    Memory: If the Master VM is configured with static memory, it must have at least 1024 MB as startup RAM. If the Master VM is configured with dynamic memory, the maximum RAM must be at least 1024 MB.
    Please check beneath article for information.
    Windows
    Server 2012 2,500-user pooled VDI deployment guide (Doc)
    Single Image Management for Virtual Desktop Collections in Windows Server 2012
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • Using collections and experiencing slow response

    I am experiencing slow response when using htmldb_collection. I was hoping someone might point me in another direction or point to where the delay may be occurring.
    First a synopsis of what I am using these collections for. The main collections are used in order to enable the users to work with multiple rows of data (each agreement may have multiple inbound and outbound tiered rates). These collections, OBTCOLLECTION and IBTCOLLECTION, seem to be fine. The problem arises from the next set of collections.
    OBTCOLLECTION and IBTCOLLECTION each contain a field for city, product, dial code group and period. Each of these fields contains a semi-colon delimited string. When the user chooses to view either the outbound tiers (OBTCOLLECTION) or the inbound tiers (IBTCOLLECTION), I generate four collections based on these four fields, parsing the delimited strings, for each tier (record in the OBT or IBT collection). Those collections are used as the bases for multiple select shuttles when the user edits an individual tier.
    Here is the collection code for what I am doing.
    When the user chooses an agreement to work with, by clicking on an edit link, they are sent to page 17 (as you see referenced in the code). That page has the on-demand process below triggered on load, after footer.
    -- This process Loads the collections used
    -- for the Inbound and Outbound tier details
         -- OBTCOLLECTION
         -- IBTCOLLECTION
    -- It is an on-demand process called on load (after footer) of page 17 --
    -- OUTBOUND TIER COLLECTION --
         if htmldb_collection.collection_exists( 'OBTCOLLECTION') = TRUE then
             htmldb_collection.delete_collection(p_collection_name => 'OBTCOLLECTION' );
         end if;
         htmldb_collection.create_collection_from_query(
             p_collection_name => 'OBTCOLLECTION',
             p_query           => 'select ID, AGREEMENT_ID, FIXED_MOBILE_ALL,
                              OF_TYPE,TIER, START_MIN, END_MIN,
                                             REVERT_TO, RATE,CURRENCY,
                                             PENALTY_RATE, PENALTY_CURR,
                       PRODUCT,CITY, DIAL_CODE_GROUP, PERIOD,
                        to_char(START_DATE,''MM/DD/YYYY''),
                                             to_char(END_DATE,''MM/DD/YYYY''),
                                             MONTHLY,EXCLUDED,
                       ''O'' original_flag
                          from outbound_tiers
                          where agreement_id = '''||:P17_ID ||'''
                          order by FIXED_MOBILE_ALL, ID',
             p_generate_md5    => 'YES');
    -- INBOUND TIER COLLECTION --
         if htmldb_collection.collection_exists( 'IBTCOLLECTION') = TRUE then
             htmldb_collection.delete_collection(p_collection_name => 'IBTCOLLECTION' );
         end if;
         htmldb_collection.create_collection_from_query(
             p_collection_name => 'IBTCOLLECTION',
             p_query           => 'select ID, AGREEMENT_ID, FIXED_MOBILE_ALL,
                              OF_TYPE,TIER, START_MIN, END_MIN,
                                             REVERT_TO, RATE,CURRENCY,
                                             PENALTY_RATE, PENALTY_CURR,
                              PRODUCT,CITY, DIAL_CODE_GROUP, PERIOD,
                              to_char(START_DATE,''MM/DD/YYYY''),
                                             to_char(END_DATE,''MM/DD/YYYY''),
                                             MONTHLY,EXCLUDED,
                              ''O'' original_flag
                          from inbound_tiers
                          where agreement_id = '''||:P17_ID ||'''
                          order by FIXED_MOBILE_ALL, ID',
             p_generate_md5    => 'YES');
         commit;The tables each of these collections is created from are each about 2000 rows.
    This part is working well enough.
    Next, when the user chooses to view the tier information (either inbound or Outbound) they navigate to either of two pages that have the on-demand process below triggered on load, after header.
    -- This process Loads all of the collections used
    --  for the multiple select shuttles --
         -- DCGCOLLECTION
         -- CITYCOLLECTION
         -- PRODCOLLECTION
         -- PRDCOLLECTION
    -- It is  an on-demand process called on load (after footer)  --
    DECLARE
       dcg_string long;
       dcg varchar2(100);
       city_string long;
       the_city varchar2(100);
       prod_string long;
       prod varchar2(100);
       prd_string long;
       prd varchar2(100);
       end_char varchar2(1);
       n number;
       CURSOR shuttle_cur IS
          SELECT seq_id obt_seq_id,
                 c013 product,
                 c014 city,
                 c015 dial_code_group,
                 c016 period
          FROM htmldb_collections
          WHERE collection_name = 'OBTCOLLECTION';
       shuttle_rec shuttle_cur%ROWTYPE;
    BEGIN
    -- CREATE OR TRUNCATE DIAL CODE GROUP COLLECTION FOR MULTIPLE SELECT SHUTTLES --
         htmldb_collection.create_or_truncate_collection(
         p_collection_name => 'DCGCOLLECTION');
    -- CREATE OR TRUNCATE CITY COLLECTION FOR MULTIPLE SELECT SHUTTLES --
         htmldb_collection.create_or_truncate_collection(
         p_collection_name => 'CITYCOLLECTION');
    -- CREATE OR TRUNCATE PRODUCT COLLECTION FOR MULTIPLE SELECT SHUTTLES --
         htmldb_collection.create_or_truncate_collection(
         p_collection_name => 'PRODCOLLECTION');
    -- CREATE OR TRUNCATE PERIOD COLLECTION FOR MULTIPLE SELECT SHUTTLES --
         htmldb_collection.create_or_truncate_collection(
         p_collection_name => 'PRDCOLLECTION');
    -- LOAD COLLECTIONS BY LOOPING THROUGH CURSOR.
         OPEN shuttle_cur;
         LOOP
            FETCH shuttle_cur INTO shuttle_rec;
            EXIT WHEN shuttle_cur%NOTFOUND;
            -- DIAL CODE GROUP --
            dcg_string := shuttle_rec.dial_code_group ;
            end_char := substr(dcg_string,-1,1);
            if end_char != ';' then
               dcg_string := dcg_string || ';' ;
            end if;
            LOOP
               EXIT WHEN dcg_string is null;
               n := instr(dcg_string,';');
               dcg := ltrim( rtrim( substr( dcg_string, 1, n-1 ) ) );
               dcg_string := substr( dcg_string, n+1 );
               if length(dcg) > 1 then
                htmldb_collection.add_member(
                   p_collection_name => 'DCGCOLLECTION',
                   p_c001 => shuttle_rec.obt_seq_id,
                   p_c002 => dcg,
                   p_generate_md5 => 'NO');
               end if;
            END LOOP;
            -- CITY --
            city_string := shuttle_rec.city ;
            end_char := substr(city_string,-1,1);
            if end_char != ';' then
               city_string := city_string || ';' ;
            end if;
            LOOP
               EXIT WHEN city_string is null;
               n := instr(city_string,';');
               the_city := ltrim( rtrim( substr( city_string, 1, n-1 ) ) );
               city_string := substr( city_string, n+1 );
               if length(the_city) > 1 then
                htmldb_collection.add_member(
                   p_collection_name => 'CITYCOLLECTION',
                   p_c001 => shuttle_rec.obt_seq_id,
                   p_c002 => the_city,
                   p_generate_md5 => 'NO');
               end if;
            END LOOP;
            -- PRODUCT --
            prod_string := shuttle_rec.product ;
            end_char := substr(prod_string,-1,1);
            if end_char != ';' then
               prod_string := prod_string || ';' ;
            end if;
            LOOP
               EXIT WHEN prod_string is null;
               n := instr(prod_string,';');
               prod := ltrim( rtrim( substr( prod_string, 1, n-1 ) ) );
               prod_string := substr( prod_string, n+1 );
               if length(prod) > 1 then
                htmldb_collection.add_member(
                   p_collection_name => 'PRODCOLLECTION',
                   p_c001 => shuttle_rec.obt_seq_id,
                   p_c002 => prod,
                   p_generate_md5 => 'NO');
               end if;
            END LOOP;
            -- PERIOD --
            prd_string := shuttle_rec.period ;
            end_char := substr(prd_string,-1,1);
            if end_char != ';' then
               prd_string := prd_string || ';' ;
            end if;
            LOOP
               EXIT WHEN prd_string is null;
               n := instr(prd_string,';');
               prd := ltrim( rtrim( substr( prd_string, 1, n-1 ) ) );
               prd_string := substr( prd_string, n+1 );
               if length(prd) > 1 then
                htmldb_collection.add_member(
                   p_collection_name => 'PRDCOLLECTION',
                   p_c001 => shuttle_rec.obt_seq_id,
                   p_c002 => prd,
                   p_generate_md5 => 'NO');
               end if;
            END LOOP;
         END LOOP;
         CLOSE shuttle_cur;
        commit;
    END;Creating these collections from the initial collection is taking way too long. The page is rendered after about 22 seconds (when tier collection has 2 rows) and 10 minutes worst case (when the tier collection has 56 rows).
    Thank you in advance for any advice you may have.

    Try to instrument/profile your code by putting timing statements after each operation. This way you can tell which parts are taking the most time and address them.

  • When to use the new file based content repository

    In Service Pack 4 there's a new implementation of the CMSPI interfaces which is configured by using the following implementation class:
    com.bea.content.spi.internal.FileSystemRepositoryImpl
    When should one use this new file based repository versus the existing one (configured by using the following class: com.bea.content.spi.internal.RepositoryImpl).
    I've read the edocs, but it doesn't state when to use this new one compared to the previous implementation.
    We consider using a third party content repository, but for the time being we will use the content repository provided by BEA.
    Trond Andersen, Invenia AS, +4798290811

    use the new keyword when you don't have an instance of that object in memory that you want to use.  For example...
    if you have an object already in memory that is holding a property with a "CamelQuery" object, then you can say 
    var query = myobject.Query;
    however, if you have to write the query, or instantiate the object from nothing, then you need to use the "new" keyword.  A good example is SPSite object...
    if you can get a new SPSite object by either "newing one up and passing the URL" or getting the farm and getting a site from that object. 
    using(SPSite site = new SPSite("url to my site"))
    now I can use site.
    //or
    SPSite = myWebApp.Sites[0];
    // this gives you site at index 0 of current webApp
    most of the time in SharePOint you will be using the "new" keyword to open site collections, and then getting your subsites from there. BE CAREFUL using the "new" keyword. If you "new" up an object that is iDisposable... you
    MUST dispose of that, but if you use that same object but it comes from the "current context", you mustn't dispose of it.
    //dispose of this by using statement
    using(SPSite site = new SPSite(<url>))
    //do stuff
    //after this bracket it is disposed.
    //do not dispose of this:
    SPSite mysite = SPContext.Current.Site;
    //unpredictable behavior can occur because you will still need references to your current site.

  • How can I work with lightroom when I use two computers ?

    I am new to Lightroom and work with a laptop at home and a PC at work. Before I started to use LR3 I simply duplicated my pic files onto both machines, edited on whichever machine I wanted and then synchronised the folders. This system provided me with a working copy at either home or work and also a backup copy on the other machine.
    I would like to operate the same system with LR3 but am unable to figure it out due to the automatic filing system used by the programmme to seperate the raw files and the instructions for those files.
    Can anyone provide me with simple step by step instructions on how to transfer the files/instructions by using  a flash drive and "Copy and replace"system
    as I am totally confused by the grammar, syntax, and terminology used by Adobe.

    Hi Geoffbubbles,
    if you see only 1 photo you did export only 1 photo in the catalog.
    Make sure you select all (e.g. <ctrl> A or remove the tick from "export selected photos only" in the dialog box of export-as-catalog =>will pick the total folder).
    What Dorin mentions are catalogs as transportation vehicles between the two LR computer catalogs.
    Let's assume you start on your home-comp and transfer to the work-comp.
    When you EXPORT you give a name "home-to-work" for the transport catalog. You decide if you include the pictures by ticking "exclude negative files".
    You would do so only for the first time, when your work-comp would not yet have them.
    These are the original files which would never be touched, but which LR needs to have available to do develop work (i.e. to write develop instructions into its database). [Or maybe only you need them in order to have LR display the effects of what you are doing, if your slider settings achieve your desired result.]
    When you transfer your new settings from the work-comp to the home-comp which has the original files already you only need to transfer the DB-records for the files, i.e. the catalog parts. Then it is sufficient to export-as-catalog (name it "work-to-home") without the tick for the negative files. Which will obviously save a lot of data to transfer.
    As would leaving off the tick for "include available previews", but then your receiving computer would have to render the previews itself - your choice where you spend the effort.
    Depending on your ticks checked in export dialog the data on the transfer stick will show different folders:
    1 wrapping folder with the name you specified as transportation catalog name (in the example above "home-to-work")
    therein the catalog file *.lrcat (home-to-work.lrcat)
    if "include negative files" ticked: as many subfolders as the original folder structure/names of the pictures in it had on the sending machine
    if "include available previews" ticked: an *Previews.lrdata-folder ("home-to-work Previews.lrdata") with lots of subfolders labelled 0...F
    On the receiving computer, when you IMPORT FROM CATALOG, you only select the *.lrcat-file.
    In the dialog box you decide if you import the negative files (prereq you had included them) or if you just add them without moving (why not leave them on the stick i.o. actually copying over to the work-comp?). If there are no new photos, but just new settings, you can either overwrite your old settings (which is probably your intention) or tick "preserve old settings as virtual copies".
    When you use Dorins smart collection "Touched today" the virtual copies should not show up upon re-export on the way "work-to-home", provided you have further tweaked the master versions only. Or they do because in the end you liked them better and continued tweaking on them.
    Note if you do not include previews: you might need to tell LR on the receiving comp to rerender the previews if it contains the photos and earlier previews already - I am not sure, if LR starts off on its own to rerender them.

  • Using collections to insert

    Hi ,
    To improve the performance of the insert statement i was adviced to use the collections.
    I'm not getting any idea on how to use collection concept in my code.
    Could you please give me a skelton approach to do that.
    The following is the sample code (the logic is same in prod code,instead of for 1 -100000 we have cursor in prod) without using collections
    create table pop_tab (     col1 number ,col2 number ,col3 number ,col4 number ) 
    create or replace package test_collect
    is
      procedure proc_lvl_ld ;
      procedure proc_pop_tab (v_var1 number ,v_var2 number ,v_var3 number ,v_var4 number) ;
    end test_collect;
    create or replace package body test_collect
    is
       procedure proc_lvl_ld
        is
          v_cnt number := 1 ;
          v_var1 NUMBER ;
          v_var2 NUMBER ;
          v_var3 NUMBER ;
          v_var4 NUMBER;
         begin
          for i in 1 .. 100000 loop
            v_var1 := v_cnt + 1;
            v_var2 := v_cnt + 2;
            v_var3 := v_cnt + 3;
            v_var4 := v_cnt + 4;
            v_cnt  := v_cnt + 1;
          proc_pop_tab (v_var1 ,v_var2,v_var3,v_var4);
         end loop;
          commit;
          exception when others then
           DBMS_OUTPUT.PUT_LINE ( 'proc_lvl_load'||sqlcode||','||sqlerrm );
        end proc_lvl_ld;
         procedure proc_pop_tab (v_var1 number ,v_var2 number ,v_var3 number ,v_var4 number)
          is
           begin
             insert into pop_tab (col1,col2,col3,col4)
                     values (v_var1,v_var2,v_var3,v_var4) ;
           exception when others then
           DBMS_OUTPUT.PUT_LINE ( 'proc_pop_tab'||sqlcode||','||sqlerrm );             
           end proc_pop_tab;
    end test_collect;Now i tried a bit using colliection to improve the insert performance and stuck how to use the collections
    create or replace package body test_collect
    is
       procedure proc_lvl_ld
        is
           TYPE numtab1 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
           data1    numtab1;
           TYPE numtab2 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
           data2    numtab2;
           TYPE numtab3 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
           data3    numtab3;
           TYPE numtab4 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
           data4    numtab4;
          v_cnt number := 1 ;
         begin
          for i in 1 .. 100000 loop
            data1(data1.count +1) := v_cnt + 1;
            data2(data2.count +1) := v_cnt + 1;
            data3(data3.count +1) := v_cnt + 1;
            data4(data4.count +1) := v_cnt + 1;
            v_cnt  := v_cnt + 1;
          --proc_pop_tab (v_var1 ,v_var2,v_var3,v_var4);
         end loop;
           forall j in 1 ..data1.count
             insert into pop_tab
                 values (  --- How to use  the above collection variables here
          commit;
          exception when others then
           DBMS_OUTPUT.PUT_LINE ( 'proc_lvl_load'||sqlcode||','||sqlerrm );
        end proc_lvl_ld;
    end;Could you please help me out in this and let me know if i'm not clear
    Edited by: Smile on Sep 7, 2012 11:37 AM

    Use:
           forall j in 1 ..data1.count
             insert into pop_tab
                 values (data1(j),data2(j),data3(j),data4(j));       Now:
    SQL> create or replace package body test_collect
      2   is
      3     procedure proc_lvl_ld
      4      is
      5     TYPE numtab1 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
      6     data1    numtab1;
      7     TYPE numtab2 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
      8     data2    numtab2;
      9     TYPE numtab3 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
    10     data3    numtab3;
    11     TYPE numtab4 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
    12     data4    numtab4;
    13    v_cnt number := 1 ;
    14   begin
    15    for i in 1 .. 100000 loop
    16      data1(data1.count +1) := v_cnt + 1;
    17      data2(data2.count +1) := v_cnt + 1;
    18      data3(data3.count +1) := v_cnt + 1;
    19      data4(data4.count +1) := v_cnt + 1;
    20      v_cnt  := v_cnt + 1;
    21        --proc_pop_tab (v_var1 ,v_var2,v_var3,v_var4);
    22       end loop;
    23     forall j in 1 ..data1.count
    24       insert into pop_tab
    25       values (data1(j),data2(j),data3(j),data4(j));  
    26    commit;
    27    exception when others then
    28     DBMS_OUTPUT.PUT_LINE ( 'proc_lvl_load'||sqlcode||','||sqlerrm );
    29   
    30      end proc_lvl_ld;
    31  end;
    32  /
    Package body created.
    SQL> exec test_collect.proc_lvl_ld;
    proc_lvl_load-6502,ORA-06502: PL/SQL: numeric or value error: number precision too large
    PL/SQL procedure successfully completed.
    SQL> Why? You declared associative arrays as NUMBER(4) while values you are trying to assign their elements are in range:
    for i in 1 .. 100000 loopIf I change it to:
    for i in 1 .. 9998 loopThen:
    SQL> create or replace package body test_collect
      2   is
      3     procedure proc_lvl_ld
      4      is
      5     TYPE numtab1 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
      6     data1    numtab1;
      7     TYPE numtab2 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
      8     data2    numtab2;
      9     TYPE numtab3 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
    10     data3    numtab3;
    11     TYPE numtab4 IS TABLE OF NUMBER (4) INDEX BY BINARY_INTEGER;
    12     data4    numtab4;
    13    v_cnt number := 1 ;
    14   begin
    15    for i in 1 .. 9998 loop
    16      data1(data1.count +1) := v_cnt + 1;
    17      data2(data2.count +1) := v_cnt + 1;
    18      data3(data3.count +1) := v_cnt + 1;
    19      data4(data4.count +1) := v_cnt + 1;
    20      v_cnt  := v_cnt + 1;
    21        --proc_pop_tab (v_var1 ,v_var2,v_var3,v_var4);
    22       end loop;
    23     forall j in 1 ..data1.count
    24       insert into pop_tab
    25       values (data1(j),data2(j),data3(j),data4(j));  
    26    commit;
    27    exception when others then
    28     DBMS_OUTPUT.PUT_LINE ( 'proc_lvl_load'||sqlcode||','||sqlerrm );
    29   
    30      end proc_lvl_ld;
    31  end;
    32  /
    Package body created.
    SQL> exec test_collect.proc_lvl_ld;
    PL/SQL procedure successfully completed.
    SQL> select count(*) from pop_tab
      2  /
      COUNT(*)
          9998
    SQL> SY.

  • How to use collect?

    hi all ,
    i want to add net value of all the line items which are in the same group
    am using collect but am unable to do that.
    plz suggest me what to do?
    DATA: BEGIN OF del_grp_data occurs 0,
            vbeln like vbap-vbeln,  " Sales document
            grkor like vbap-grkor,  " Delivery group
            netwr like vbap-netwr, "net value
            posnr like vbap-posnr,  " Sales document item
             End OF del_grp_data.
    SELECT vbeln grkor pstyv netwr
        posnr
       FROM   vbap
        INTO corresponding fields of  TABLE del_grp_data
        FOR ALL ENTRIES IN orders_vbeln
        WHERE vbeln eq orders_vbeln-vbeln.
    loop at del_grp_data.
    collect ord_grp_data .
    endloop.
    Regards,
    Amit.

    Basic form
    COLLECT [wa INTO] itab.
    Addition:
    ... SORTED BY f
    Cannot Use Short Forms in Line Operations.
    Effect
    COLLECT allows you to create unique or summarized datasets. The system first tries to find a table entry corresponding to the table key. (See also Defining Keys for Internal Tables). The key values are taken either from the header line of the internal table itab, or from the explicitly-specified work area wa. The line type of itab must be flat - that is, it cannot itself contain any internal tables. All the components that do not belong to the key must be numeric types ( ABAP Numeric Types).
    If the system finds an entry, the numeric fields that are not part of the table key (see ABAPNumeric Types) are added to the sum total of the existing entries. If it does not find an entry, the system creates a new entry instead.
    The way in which the system finds the entries depends on the type of the internal table:
    STANDARD TABLE:
    The system creates a temporary hash administration for the table to find the entries. This means that the runtime required to find them does not depend on the number of table entries. The administration is temporary, since it is invalidated by operations like DELETE, INSERT, MODIFY, SORT, ...). A subsequent COLLECT is then no longer independent of the table size, because the system has to use a linear search to find entries. For this reason, you should only use COLLECT to fill standard tables. U
    SORTED TABLE:
    The system uses a binary search to find the entries. There is a logarithmic relationship between the number of table entries and the search time.
    HASHED TABLE:
    The system uses the internal hash administration of the table to find records. Since (unlike standard tables), this remains intact even after table modification operations, the search time is always dependent on the number of table entries.
    For standard tables and SORTED TABLEs, the system field SY-TABIX contains the number of the existing or newly-added table entry after the APPEND. With HASHED TABLEs, SY-TABIX is set to 0.
    Notes
    COLLECT allows you to create a unique or summarized dataset, and you should only use it when this is necessary. If neither of these characteristics are required, or where the nature of the table in the application means that it is impossible for duplicate entries to occur, you should use INSERT [wa INTO] TABLE itab instead of COLLECT. If you do need the table to be unique or summarized, COLLECT is the most efficient way to achieve it.
    If you use COLLECT with a work area, the work area must be compatible with the line type of the internal table.
    If you edit a standard table using COLLECT, you should only use the COLLECT or MODIFY ... TRANSPORTING f1 f2 ... statements (where none of f1, f2, ... may be in the key) enthalten sein). Only then can you be sure that:
    -The internal table actually is unique or summarized
    -COLLECT runs efficiently. The check whether the dataset
    already contains an entry with the same key has a constant
    search time (hash procedure).
    If you use any other table modification statements, the check for entries in the dataset with the same key can only run using a linear search (and will accordingly take longer). You can use the function module ABL_TABLE_HASH_STATE to test whether the COLLECT has a constant or linear search time for a given standard table.
    Example
    Summarized sales figures by company:
    TYPES: BEGIN OF COMPANY,
            NAME(20) TYPE C,
            SALES    TYPE I,
          END OF COMPANY.
    DATA: COMP    TYPE COMPANY,
          COMPTAB TYPE HASHED TABLE OF COMPANY
                                    WITH UNIQUE KEY NAME.
    COMP-NAME = 'Duck'.  COMP-SALES = 10. COLLECT COMP INTO COMPTAB.
    COMP-NAME = 'Tiger'. COMP-SALES = 20. COLLECT COMP INTO COMPTAB.
    COMP-NAME = 'Duck'.  COMP-SALES = 30. COLLECT COMP INTO COMPTAB.
    Table COMPTAB now has the following contents:
               NAME    | SALES
              Duck    |   40
              Tiger   |   20
    Addition
    ... SORTED BY f
    Effect
    COLLECT ... SORTED BY f is obsolete, and should no longer be used. It only applies to standard tables, and has the same function as APPEND ... SORTED BY f, which you should use instead. (See also Obsolete Language Elements).
    Note
    Performance:
    Avoid unnecessary assignments to the header line when using internal tables with a header line. Whenever possible, use statements that have an explicit work area.
    For example, " APPEND wa TO itab." is approximately twice as fast as " itab = wa. APPEND itab.". The same applies to COLLECT and INSERT.
    The runtime of a COLLECT increases with the width of the table key and the number of numeric fields whose contents are summated.
    Note
    Non-Catchable Exceptions:
    COLLECT_OVERFLOW: Overflow in an integer field during addition
    COLLECT_OVERFLOW_TYPE_P: Overflow in a type P field during addition.
    TABLE_COLLECT_CHAR_IN_FUNCTION: COLLECT on a non-numeric field.
    Related
    APPEND, WRITE ... TO, MODIFY, INSERT
    Additional help
    Inserting SummarizedTable Lines

  • When I use lightroom mobile it does not show all the photos in my camera roll.  I have 57 and it only shows 32

    WHen I use lightroom mobile  I have 57 photos on my iphone . I transfer them to my ipad and then I try to put them in Lightroom mobile from my ipad camera roll and only 32 show and transfer

    Same problem here, and with even fewer photos. There should be 14 photos (per the LR collection info), but when I view on my iPhone (5s), only 11 appear. They do all appear on my computer.  I've tried the following to make it work on my phone:
    Creating a new collection and importing there. It says one photo is in the collection, but none actually appear.
    Completely shutting down and rebooting the iPhone.
    Deleting and re-downloaded the app.
    None of these have worked.

Maybe you are looking for

  • Cinema Display hookup via a Thunderbolt drive

    I believe it's possible to run a Cinema Display from my MBP via a Thunderbolt drive, going from the MBp to the TB and then, via a Mini-display to DVI cable, into the display. I've hooked it up this way with the display also plugged into its power sup

  • Can't find FeedDownloadHook implmentation Class

    Hi I have created a Download hook for the data feeder by implmenting FeedDownloadHook the problem is that the class is not seen how can I configure to solve this problem the thrown exception is: java.lang.ClassNotFoundException: java.lang.ClassNotFou

  • How to set variable values in Stored Procs

    Hi all, please excuse my newbie questions - I've spent too long using SQL Server...... Anyway, I'm playing with SP basics and was wondering how I can set a variable value in a stored proc, ideally getting a value from a table or some select . for ins

  • Filter Not working in ALV grid

    Hi All, The filter button in ALV Grid is not working for some fields. if the filter button is selected for a particular field in the ALV grid then no entries are getting displayed in the ALV. For few fields it is working. for few fields is it not dis

  • When i try to put my app from itunes to my iphone5 it will show on the desktop but its not on my phone

    when i try to put my app from itunes to my iphone5 it will show on the desktop but its not on my phone