looking for best practices on the display of the data inside a TableView

I have an app that can extract one ore more of 300,000 lines as a result of a request, and I am their display in a TableView... I use a mechanism to bring the data "off-site", when I do the query, an object with the ID of the lines is set in memory and a 'queryResultKey' went to start asking for the data set.
The controllers send the queryResultKey saying the DAO that she already results N, the DAO will return X records (from N + 1 to N + J) or less if the total number of records is reached. At this point, records are added to the elements of the table view using an addAll to list related to the itemsProperty table.
It works very well for early records already, but all of a sudden a Null pointer Exception is raised:
ene 15, 2013 12:56:40 PM mx.gob.scjn.iusjfx.presentacion.tesis.TablaResultadosController$5 call
SEVERE: null
java.lang.NullPointerException
     at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:291)
     at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:48)
     at com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList.callObservers(ReadOnlyUnbackedObservableList.java:74)
     at javafx.scene.control.TableView$TableViewArrayListSelectionModel$3.onChanged(TableView.java:1725)
     at com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:134)
     at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:48)
     at com.sun.javafx.collections.ObservableListWrapper.callObservers(ObservableListWrapper.java:97)
     at com.sun.javafx.collections.ObservableListWrapper.clear(ObservableListWrapper.java:184)
     at javafx.scene.control.TableView$TableViewArrayListSelectionModel.quietClearSelection(TableView.java:2154)
     at javafx.scene.control.TableView$TableViewArrayListSelectionModel.updateSelection(TableView.java:1902)
     at javafx.scene.control.TableView$TableViewArrayListSelectionModel.access$2600(TableView.java:1681)
     at javafx.scene.control.TableView$TableViewArrayListSelectionModel$8.onChanged(TableView.java:1802)
     at com.sun.javafx.scene.control.WeakListChangeListener.onChanged(WeakListChangeListener.java:71)
     at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:291)
     at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:48)
     at com.sun.javafx.collections.ObservableListWrapper.callObservers(ObservableListWrapper.java:97)
     at com.sun.javafx.collections.ObservableListWrapper.addAll(ObservableListWrapper.java:171)
     at com.sun.javafx.collections.ObservableListWrapper.addAll(ObservableListWrapper.java:160)
     at javafx.beans.binding.ListExpression.addAll(ListExpression.java:280)
     at mx.gob.scjn.iusjfx.presentacion.tesis.TablaResultadosController$5.call(TablaResultadosController.java:433)
     at mx.gob.scjn.iusjfx.presentacion.tesis.TablaResultadosController$5.call(TablaResultadosController.java:427)
     at javafx.concurrent.Task$TaskCallable.call(Task.java:1259)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
     at java.util.concurrent.FutureTask.run(FutureTask.java:166)
     at java.lang.Thread.run(Thread.java:722)
This exception multibordure inside the Thread that fills the table:
task = new Task<Integer>() {
            @Override
            protected Integer call() throws Exception {
                while (listaTesis.size() < pag.getLargo()) {
                    List<TesisTO> tesisParaincrustar = fac.getTesisParaLista(pag.getId(), listaTesis.size());
                    try {
                        listaTesis.addAll(tesisParaincrustar);
                    } catch (Exception exc) {
                        Logger.getLogger(TablaResultadosController.class.getName()).log(Level.SEVERE, null, exc);
                    }
                    tesisActuales.addAll(tesisParaincrustar);
                    updateProgress(listaTesis.size(), pag.getLargo());
                }

                return new Integer(100);
            }

            @Override
            protected void succeeded() {
                status.getProgreso().setVisible(false);
                preparaFiltros();
                llenandoTabla = false;
                tblResultados.getSelectionModel().select(0);
            }
        };
        status.getProgreso().progressProperty().bind(task.progressProperty());
        new Thread((Runnable) task).start();
So that may be another strategy to simulate (or have) all the registry values are in memory and 'capture only the necessary links' to display them in the TableView?
Any idea will be useful.

The first thing I would do here is to check that

fac.getTesisParaLista(pag.getId(), listaTesis.size())

cannot return null in all circumstances. If it returns null, then it is the source of your exception. In this case, you must add the caution appropriate to your code:

if (tesisParaincrustar != null) {
                    try {
                        listaTesis.addAll(tesisParaincrustar);
                    } catch (Exception exc) {
                        Logger.getLogger(TablaResultadosController.class.getName()).log(Level.SEVERE, null, exc);
                    }
                    tesisActuales.addAll(tesisParaincrustar);
}

For the number of thread, you can plan everything which modifies the user interface to run on the Thread of the FX Application using Platform.runLater (...). Note that any data that you pass into that must not be changed elsewhere. If you can do something like:

Platform.runLater(new Runnable() {
  @Override
  public void run() {
                    try {
                        listaTesis.addAll(tesisParaincrustar);
                    } catch (Exception exc) {
                        Logger.getLogger(TablaResultadosController.class.getName()).log(Level.SEVERE, null, exc);
                    }
                    tesisActuales.addAll(tesisParaincrustar);
  }
});

You need to add the 'final' keyword to the declaration of tesisParaincrustar to get this to compile.

That's fine, assuming that the call to fac.getTesisParaLista (...) returns a new instance of the list each time (i.e. it does not change an existing list).

You'll end up with only one problem: the condition in your while loop (...) refers to listaTesis.size (). Given that this list is now updated on a different thread to the thread of the while loop (...) management. This can (and probably won't be) cause the loop to terminate at the wrong time. You can adjust the condition while (...) so it does not refer to this list (for example, advance calculate how many things must be read, give this number to your implementation of the task and use it in the while condition (...).)

There are actually two rules for multithreading in JavaFX:
1. do not access the user interface outside the FX request Thread. This includes data related to the user interface structures. I guess at some point you have called tableView.setItems (listaTesis), so listaTesis should be considered as part of the user interface.
2. don't run long running on the Thread of the FX Application tasks.

In trying to comply with rule 2, you have violated rule 1.

The incremental updates to a list that appears in a background thread is one of the most delicate uses of the task. Read the documentation of the API for task (http://docs.oracle.com/javafx/2/api/javafx/concurrent/Task.html): the example of "PartialResultsTask" under "a task that returns partial causes" is an example of what you're trying to do.

Tags: Java

Similar Questions

  • Beginner looking for best practices to implement my first ESXi server.

    Hello, tomorrow I will start my first company ESXi.  I ordered a HP Proliant ML350 with e200i Raid 5 controller.  I bought 4 1 TB Sata disks and plan to put them all in Raid 5 for 3 TB of data storage.  I currently have a file Win2k3 server which has approximately1.5TB of files on several physical disks spread now.  My question is how these data should be moved to the new server?  Should I build a new machine virtual server OS 2003 or 2008 and then allocate all 1.5 + TB I this one VM?  How the data will look like ESXi?  Have I not separated or just 1 virtual players a large?  Or is there a better solution?  What should I do when I start running out of space and should allocate more space to the descent to a certain VM?  I apologize if this is a stupid question, but I'm just a little confused and trying to get all oriented upward when I started on this project in the future.

    Thank you very much!

    Dave

    You can build on Windows Server as shown above, and then create a virtual disk to host your data. You can then use something like copy robo to synchronize the data from your original data source, you could kick off for a weekend and then use robocopy to just capture changes before making your actual failover. Just be aware of the limits that the other person has remarked with the 2 TB. You can select the block maximum size when you create your VMFS datastore for your data drive, otherwise the VMDK max, you create will be a little less then you are looking for.

  • I'm looking for 'best practices' tips for a configuration of a project (first CS5.5, Windows 7 Pro)

    I was instructed to update an old corporate video with narration, sounds, graphics and new music.

    Video camera ONLY material that I've had a DVD corporate (NTSC) - the original source material is simply not available. .

    I can rip the DVD in MPEG 2 and import it into first without problem, but I would like to be able to use resolutions higher the updated graphics.

    I intend to export it to Youtube (HD) but can export to DVD or BluRay as well.

    My question really reduced management of sequences.   I tell myself that my sequence settings must be the highest resolution, I expect to work with (Youtube HD or Bluray) which allows you to easily export to lower quality, but I don't really know if it's as simple as that.  Is there a standard method in the industry?  Am I close?

    First may actually use the DVD .vob files, just copy DVDs to hard disk, and then import in first.

    What is the DVD existing video in a 4:3 or 16:9 format? If 4:3, think about how you will work in a program of 16:9. Rather than having the black terminal on the side bars, many publishers will some sort of background to fill this space. A popular solution is to reproduce a bass track, stretch 4:3 video to fill the screen and add Gaussian blur effects. Because the colors/content of the sidebars will correspond to the main video, it's a little disguises the fact that the video is 4:3.

    If you put SD images in a HD program, it will look 'soft' compared to the HD images. As a compromise, you can consider the new edition as 720 p instead of 1080 p program, so that the SD resolution is not to be tense. All the computer video/video YouTube is not interlaced, meaning to sequences and exports should be done as Progressive.

    Flow problem of potential work - if you take the images existing SD from the DVD and it high end in a HD sequence, then export to DVD (SD resolution), the video turned into mush. She was raised, and then again once, dowscaled really kill the quality. May be required to copy the HD sequence in a sequence of SD, difficulty of the problems of size / scale of graphics and titles and DVD for the export of the sequence of SD to avoid the top of range/reduce images SD. Note that the DVD-video is highly compressed, so you already work with a weak source material, recompress again will be a hit in quality in all cases, but certainly avoid the top of range/cut again.

    I don't have Adobe apps in front of me at the moment, but I think that Blu - ray 720 p export options are limited, perhaps 720 p at 59.94 only, not sure. Which may affect your decision to 1080 p and 720 p.

    Hope these tips help you

    Thank you

    Jeff Pulera

    Safe Harbor computers

  • Beginner looking for best practices in configuration in AE CS4 (MacPro 8core)

    Hello

    I am a video editor familiar with FCP and motion, moving in AE CS4 because it's more power in a 3D space. I installed the program and started my basic training of Lynda, but I want to make sure I got the installer so as not to cause problems on the road of.

    For example, in FCP, I use a second drive for makes etc., and a RAID array for FCP files and various media (both imported and exported) organized by project and by type. I intend to do the same for EI, but looking at the AE prefs, I see I can assign memory per CPU etc, and I just want to be sure that I use the Procs and RAM effectively. The machine is a machine of 8-Core MacPro with 12 GB of RAM. The program sees 16 processor cores, so I should split the 10 GB hosting AE to use during these carrots (using the pref multiprocessing tab), or simply let AE understand?

    In addition, I am confused about the overflow Volumes option. What gets put there, when and why?

    Finally, if there is a newsletter along the lines of the Larry Jordan FCP (larryjordan.biz) site I'd reference.

    Thanks for your help.

    -C

    Concerning the use of RAM and processor, see the following page:"Performance Tip: don't starve to death your software of RAM '. Following the guidelines there for 12 GB your computer, would you let 2 GB for other applications, perhaps a couple of GB for the trial leading to hold executives preview RAM - leaving you with 2 GB each of four background rendering process.

    Also, don't be fooled. 8-core computer is just an 8-core in After Effects is. The so-called doubling of processor cores created by hyperthreading is not relevant for simultaneous rendering of several images of multiprocessing.

    Regarding overflow volumes, see the following page: "of the volume of overflow and segment settings"

    If you are new, please start here. Pretty please?

  • After submitting my info, I had the SERVER ERROR: 500 internal server error! There is a problem with the resource you are looking for, and it cannot be displayed. :

    Over the four days, I've lost two e-mail accounts:

    1 * e-mail address is removed from the privacy *

    2nd * e-mail address is removed from the privacy *

    I went to www.windowslivehelp.com

    I filled in all the information and answered all the question. I provided

    the email address where I can be reached: * address email is removed from the privacy *

    But when I click on submit

    "The display shows:" Server error

    500 internal Server Error. There is a problem with the resource you

    can are looking for, and it cannot be displayed' you explain or tell me

    How can I return my email accounts. Thank you and best regards

    B.Okediji sanogo

    {deleted}

    E-mail address is removed from the privacy *.

    Hi Zacheus B.Okediji,

    1. what web browser do you use?

    2. when the problem started?

    The website you are visiting had a server problem preventing the display of the Web page. It often occurs due to maintenance of the site, or due to a programming error on interactive websites that use scripts.

    For more information, see the following article:

    Get help with the Web site (HTTP error) error messages.

    If you use Internet Explorer, you can read the following article and try steps 2, 3 and 4 to solve the problem.

    Internet Explorer is slow? 5 things to try

    Note: Resetting the Internet Explorer settings is not reversible. After a reset, all previous settings are lost and cannot be recovered.

    You can also visit the following links to support Windows Live:

    "Server too busy", "Internal Server Error" and we do little maintenance to improve the service.

    Internal server error when trying to open hotmail

    Hope this information is useful.

  • Looking for some practice files for video in line/book of "Adobe Photoshop CS5 Extended: Essentials. I use the tutorial via membership in Safari book online and the files are not available on Safari.  Do you know where I can get the files?

    Looking for some practice files for video in line/book of "Adobe Photoshop CS5 Extended: Essentials. I use the tutorial via membership in Safari book online and the files are not available on Safari.  Do you know where I can get the files?

    Looks like the manufacturer was "Total Training. I can't find the title to Adobe.com

    http://totaltraining.com/store/Photoshop-CS5-extended-Essentials/

  • You are looking for an application unzip the files on iMac

    You are looking for an application unzip the files on iMac. I can find lots of 3rd party applications, but how do I know that they are safe? When I look in the app store, they say for iPhone or iPad can I use one of these?

    THX

    1. There is usually no additional software to do so; Simply double-click the zip in the Finder. If this method does not work for any reason, use The Unarchiver.

    2 No.

    (140768)

  • I am looking for regentry.chm of the Windows 2000 Resource Kit.

    I am looking for regentry.chm of the windows 2000 resource kit

    Hello

    Because you are using the Windows 2000 resource kit, it will be better to post the same question in the Technet forums and check if it helps.

    You can follow the link to your question:

    Windows Small Business Server: http://social.technet.microsoft.com/Forums/en-us/category/sbsserver

  • Looking for an update of the bios for Acer aspire M1641 motherboard

    Looking for an update of the bios for Acer aspire M1641 motherboard

    All I could find was the one for the acer aspire M1640 which has a different card number, but is as close as I can get for it. That's the good? If this isn't the case, anyone would be able to point me in the right direction?

    Thank you.

    FTP://FTP.Acer-euro.com/desktop/aspire_m1641/BIOS/

  • Looking for specific files of the .bkf. Is this possible?

    I have an external drive on which I had saved the entire desktop.  Desktop is dead (without power on/off switch) and now have a new laptop.  Looking for specific files of the .bkf.  Is this possible? If this is not the case, how can I 'restore' old office files to new pc? XP on desktop and laptop.

    What are the Windows Vista forums. Please repost your questions in the forum XP here: http://social.answers.microsoft.com/Forums/en-US/category/windowsxp.

  • Microsoft Flight Simulator has stopped working. Windows is looking for a solution to the problem

    Original title: games

    When I start my X Microsoft Flight Simulator (Deluxe Edition), it is running propely for some time (15 to 20 minutes) that it no longer works and gives me a message "Microsoft Flight Simulator has stopped working. Windows is looking for a solution to the problem"and he have me to close the program. (I have Windows 7)

    Help, please. :)

    I just "uninstalled" pack of the accelerator, and it worked fine.

  • Looking for ways to solve the following problems of these messages: "check the temp environment variable. "Unable to print the document. "You don't have permission to save in this location."

    Looking for ways to solve the following problems of these messages: "check the temp environment variable. "Unable to print the document. "You don't have permission to save in this location."

    Hi Michael,

    Please follow the link and see the issue:

    Cannot print or preview before printing a Web page in Internet Explorer: http://support.Microsoft.com/kb/973479

    If the problem is specific to MS Word, then I suggest you to post the same question in the forums of MS Office for assistance.

    Microsoft Office Forum:

    http://answers.Microsoft.com/en-us/Office/Forum/Word

    I hope this helps.

  • I'm looking for a link to the 'Adobe Creative Suite Design Premium' Netherlands/Dutch version

    I'm looking for a link to the 'Adobe Creative Suite Design Premium' Netherlands/Dutch version. I was promised this week to be contacted by a "senior" by Adobe support person. But after 5 days still nothing. Need help finding the download package. It is not available via the Adobe Web site.

    Who can help me please?

    [Go to the living room to a support forum - Moderator]

    I think it's more creative Cloud as Creative Suite.

    Language switching in Cloud applications is a preference setting. Switching language non-Cloud has always required contacting Adobe, as the license is tied to the language. Language files must be included with the installer and the legacy versions are archived with different groups of language files.

    For the Suites and standalones inside each suite - I have always understood that the languages listed next to each link are the only ones to be included in this specific download.

    Very few languages listed for CS5 Design Premium. No Dutch so I do not think the OP won't get a Dutch version of one of the links below.

  • Hi, I m looking for a decoding of the 0x6101be5 fault code. Any idea to solve this problem?

    Hi, I m looking for a decoding of the 0x6101be5 fault code. Any idea to solve this problem?

    Type of the printer is Photosmart D5460

    Thanks a lot for hel

    steviedanielle

    It could be a work around. each time u replace each cartridge. Turn on the printer and check if that make all the difference... Although the chances of losing these cartridges are more unless your next printer uses the same cartridge

  • Looking for best software Acrobat Writer/Conversion for Excel 2003.   I have Standard but you want to update.  Anyone have any ideas?

    Looking for best software Acrobat Writer/Conversion for Excel 2003.   I have Standard but you want to update.  Anyone have any ideas?

    Hi Dennis,

    Acrobat CC is not compatible with MS Office 2003 and currently, we only sell Acrobat DC. However, if you opt for a subscription of Acrobat DC you can install and use Acrobat XI that is compatible with Office 2003, but only to a certain update.

    Please check details of compatibility here: web browsers and applications of PDFMaker

    Thank you

    Abhishek

Maybe you are looking for

  • Qosmio G50 - cannot install the FM Tuner in Windows Vista Media Center?

    Can someone help me get the most out of Windows Vista media center with my new Qosmio G50. There is a tuner inside this laptop and I have the antenna and its plugged in. The drivers all seem to be installed but WMC tells me that I don't have the hard

  • WRT300N dead?

    Didn't all of a sudden my router. When I turn it on, the front lights are flashing as usual, then turns all the lights of the port and the router turns off. No idea what could be the problem? This is version 2, bought new in 2006, with the original f

  • Invisible MP3 files in Windows Media Player

    After a registry cleanup, I ended up in a strange situation. Windows Media Player 11 will play MP3 very well, if I double click on an MP3 file in Windows Explorer to the media player will start and play the file. If however in Media Player, I open a

  • Prevent covers Album in Windows Media Player download

    I spent a lot of time fixingand manually editing my music with images 500x500px album art.I read the article on http://social.answers.microsoft.com/Forums/en-US/w7music/thread/6ff8c9fd-d97f-4304-bad5-693f7dbb4532/ but is not my problem - I can add th

  • Windows does not recognize the iPod device

    installs of XP | Files, folders & storage> Windows 7 Pro. My iPod Touch will contact the iTunes computer software, but the computer won't recognize as a device, so pictures and videos cannot be transferred back through Explorer or software with call