Faster Table updating


		public void refresh(Refresher source) {
			
			doUpdates();

			log.debug(" Refreshing the log table... ");		
			
            source.setRefreshInterval(5000);
			
		}
		
		public void doUpdates() {
	
			List<TestRecord> listparsers = null;

			TypedQuery<TestRecord> query = emDatabase.createQuery("SELECT p FROM TestRecord p ORDER BY p.dlastrun DESC", TestRecord.class);
			listparsers = query.getResultList();
            
            log.debug("Getting list for table log - record count: " + listparsers.size() ) ;
            
    	    for (final TestRecord currentparser: listparsers) {	

    	        // add item to table and set properties from POJO
    	    	Item userItem = tableLog.getItem( currentparser.getFilename() );
    	    	
    	    	if (userItem == null) {
    	    		
    	    		log.debug( "Record not in table log - adding it..." );
    	    		userItem = tableLog.addItem( currentparser.getFilename() );
    	    		
    	    	} else {
    	    		
    	    		log.debug( "Record in table log - updating it..." );
    	    		
    	    	}
    	        
    	        userItem.getItemProperty("startdate").setValue( currentparser.getDstartdate() );
    	        userItem.getItemProperty("lastrun").setValue( currentparser.getDlastrun() );
    	        
    	        userItem.getItemProperty("filename").setValue( currentparser.getFilename() );
    	        userItem.getItemProperty("nb").setValue( currentparser.getFieldmap().get("original_notebookid") );
    	        
    	        userItem.getItemProperty("parserstatus").setValue( currentparser.getParser_status()  );
    	        
    	        String completestatus = "";
    	        if ( currentparser.getComplete_flag() )
    	        	completestatus = "COMPLETE";
    	        else
    	        	completestatus = "INCOMPLETE";
    	        
    	        userItem.getItemProperty("completestatus").setValue( completestatus );
    	        
    	        userItem.getItemProperty("request").setValue( currentparser.getFieldmap().get("requestname")  );
    	        userItem.getItemProperty("instrument").setValue( currentparser.getInstrument() );
    	        userItem.getItemProperty("user").setValue( currentparser.getUser()  );
    	        userItem.getItemProperty("testcode").setValue( currentparser.getTestcode() );
    	        
				NativeButton logButton = new NativeButton("View", new ClickListener() {

                    private static final long serialVersionUID = 1853033559487312373L;

                    public void buttonClick(ClickEvent event) {
						
						Window logWindow = new Window();
						
						RichTextArea logbox = new RichTextArea();
						logbox.setValue( currentparser.getLog() );
						logbox.setWidth("100%");
						
						logWindow.addComponent(logbox);
						logWindow.setWidth("500px");
						logWindow.setModal(true);
						
						getApplication().getMainWindow().addWindow(logWindow);
					}

				} );
    	        
    	        userItem.getItemProperty("log").setValue( logButton ); 
    	        
    	    } // for (final TestRecord currentparser: listparsers)
 
		} // public void getUpdates()