Simultaneous updation of View and calculation

Hello,
I need to procees huge data, and update it to a table. row by row. since all the updation takes a large amount of time, I am planning to update date after a certain calculation is done, (The updation is to a JTable) but the view is getting updated only after all the processing is done. Please tell me the best way to handle this kind of data updation, any design pattern that can be used... etc
Waiting eagerly.....
Message was edited by:
serjith

You can learn more about it here Lesson: Concurrency in Swing.
import javax.swing.*;
import javax.swing.table.TableModel;
public class UpdateInTime implements Runnable {
    JTable table;
    Thread thread = null;
    boolean working = false;
    public void run() {
        int count = 0;
        while(working && count < table.getRowCount()) {
            try {
                Thread.sleep(3000);
            } catch(InterruptedException e) {
                working = false;
                System.out.println("interrupted");
            System.out.println("updating row " + (count+1));
            TableModel model = table.getModel();
            int cols = model.getColumnCount();
            for(int j = 0; j < cols; j++) {
                Object value = "item " + (count*cols + j+1);
                model.setValueAt(value, count, j);
            count++;
        working = false;
        System.out.println("update cycle completed");
    private JScrollPane getComponent() {
        table = new JTable(12, 4);
        return new JScrollPane(table);
    private void start() {
        working = true;
        thread = new Thread(this);
        thread.setPriority(Thread.NORM_PRIORITY);
        thread.start();
    public static void main(String[] args) {
        UpdateInTime test = new UpdateInTime();
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(test.getComponent());
        f.setSize(400,400);
        f.setLocation(200,200);
        f.setVisible(true);
        test.start();
}

Similar Messages

  • Updatable Materialized View and Master Table on same database

    Hi all,
    My first question - Is it possible to have an Updatable Materialized View and the associated Master Table located on the same database?
    This is the requirement scenario:
    One unique database D exists.
    A is a batch table. Only inserts are allowed on Table A.
    M is an updatable materialized view on Table A (Master). Only updates are allowed on M (no insert or delete).
    Requirement is to push updates/changes from M to A periodically and then get the new inserted records from A into M via a refresh.
    Is this possible? What other approaches are applicable here?

    John,
    My question is related to the implementation and setup of the environment as explained in the above example. How can I achieve this considering that I have created an updatable m-view?
    If possible, how do I push changes made to an updatable m-view back to it's master table when/before I execute DBMS_MVIEW.REFRESH on the m-view? What is the procedure to do this if both table and mview exist on the same database? Do I need to create master groups, materialized view refresh groups, etc.?
    One more thing.. Is there a way to retain changes to the m-view during refresh? In this case, only newly inserted/updated records in the associated table would get inserted into m-view. Whereas changes made to m-view records would stay as-is.
    Hope my question is directed well. Thanks for your help.
    - Ankit

  • Simultaneous update of Oracle and Cache memory

    What is the mechanism to maintain data integrity in case there is simultaneous update request to both Oracle DB and IN-Memory DB
    Is there a locking mechanism to prevent such cases

    I assume you are referring to the specific case where TimesTen is being used as a cache for Oracle data and the data is updateable in both places? There is no mechanism to prevent simultaneous update in both. Such a mechanism would introduce an unacceptably high performance overhead thereby negatibe the value of using TimesTen. Best practice dictates that one designs and implements the system in such a way that for any particular piece of data only one of TimesTen or Oracle is the 'master' thereby ensuring that this situation does not arise.
    Chris

  • The Apple Excel viewer and calculated fields.

    I'm told over at the Dropbox community that the iOS Dropbox app hooks into an Excel spreadsheet viewer provided by Apple & that I should ask my question here.
    I am using the Dropbox App to view one of my spreadsheets on my iPhone (7.0.4).  The spreadsheet has a calculated date field =TODAY().  When I look at the file on my iPhone I see the date displayed is always the date that I uploaded the file to Dropbox, and it never recalculates to "today's date".
    How can I make the viewer recalculate the spreadsheet?
    Many thanks.

    I think will be better if I expose what I want to do.
    I have a DO with 2 fields that I have to use to send the alert I want. The first one is the total of aprovals, the second one it is the total of denials. Each record have value for aproval and denial and have the time that operation ocurred. So what I want is to know if the total of approval in that hour it is bellow some %, if I have records in a time that it is inside the 3pm hour like 3:01 or 3:45 or 3:57 it counts as 3:00pm. so if the sum of those 3 records it is bellow the % I have to send a alert. I coulldnt make this happen and I tried everything and I m almost thinking that BAM cannot do this.

  • I am trying to update Adobe Bridge and Photoshop CS6, because it is not opening my CR2 files taken by my Canon 6D.  I have tried to go to help updates, and the software says that it is "Up to Date".  However, if I view the plug-in, it says that Camera R

    I am trying to update Adobe Bridge and Photoshop CS6, because it is not opening my CR2 files taken by my Canon 6D.  I have tried to go to help > updates, and the software says that it is "Up to Date".  However, if I view the plug-in, it says that Camera Raw is only version 7.1.  I can not find a direct download for Camera Raw 7.3, only the DNG converter, NOT CAMERA RAW!  Please Help!

    Did you fix your issue?  I am having the same one

  • Im trying to update my apps and it wont let me. When i clicked on an app to update it or to download a free app it says "sign in required, tap continue and sign in to view your billing information" when i did it says "you must verify your payment info be

    Im trying to update my apps and it wont let me. When i clicked on an app to update it or to download a free app it says "sign in required, tap continue and sign in to view your billing information" when i did it says "you must verify your payment info before you can makes purchases" then "security code is invalid" when the security code is valid. I even switched credit card it keeps saying the same thing....... THIS IS NOT FAIR........ I WANNA UPDATE MY APPS!!!!! Btw idk why did i buy the ipad for, APPLE dont even let you download ADOBE FLASH PLAYER and must of the games required ADOBE FLASH PLAYER to play example: wizard101. Idk what i was thinking...... :(

    Why not simply remove yoru payment info by selecting None at top?
    APPLE dont even let you download ADOBE FLASH PLAYER
    Considering Adobe dont (sic) even make Flash Player for iPads, this seems about right. How can you download something that does not exist?

  • HT5055 Just updated to lion and my cctv access has stopped functioning all I get is a white screen in the middle of the control panel where the camera shots should be.  I think it is caused by JAVA but am confused as when i view on snow leopard it works 

    Just updated to lion and my cctv access has stopped functioning all I get is a white screen in the middle of the control panel where the camera shots should be.  I think it is caused by JAVA but am confused as when i view on snow leopard it works  can you help

    Open "Java Preferences" either from spotlight or your utilities folder...it's probably going to say you need to install a java runtime. Then just click install!

  • View based form updation in 6i and 10g forms.

    Hi All,
    I am facing a strange problem.
    I created a form based on a view, which is based on a single table. i made a copy of the form and converted it to 10g.
    When running in 6i, i can update the data through forms. But in 10g, its showing FRM-40602: Cannot insert into or update data in a view.
    Can anyone tell what is wrong?
    Thanks & Regards,
    Manu.

    hi Manu
    How to insert new record or update existing record using a complex view?
    to make dml against a complex view with instead of triggers a reality. There should be no need to write an on-update trigger in your form. Indeed, the reason for a view and instead-of-trigger on that view is so that you do not require additional coding in your form.
    1) you need the instead-of-trigger on the view (confirm it is there)
    2) you need to change the locking mode in the form for the block based on your view so that it uses the logical key for locking purposes. There is a lock mode setting somewhere in the block properties page, find it, understand the differences and pick the righ tone (I forget at this moment which on it is, try them all if necessary).
    3) #2 will involve selecting those fields that map to the business identifier/primary key you want to you use for finding rows. You need to visit each field's property page and set the appropriate attribute to indicate that is is part of the key used to find rows. It is there on the properties page but not having forms available at the moment I cannot give you the property name. You will have to do a little exploring to find it.
    If you do these things, the error should go away and the view become updatable via oracle forms without the need to write any on-update trigger.
    Do some testing at the database level first. Make sure you can update the view directly via sqlplus first with the instead-of-trigger before you attempt it in the form. This will ensure that your issue is forms related and not database related. This is an important step because the database will return a similar error to what you have reported if the instead-of-trigger does not exist on the view.
    sarah

  • HT3702 I'm trying to update a game and its telling me I need to view my billing.i check my billing and it isn't giving me a none option. It's forcing me to put a credit card in, in order to update a game. Help please:(

    I'm trying to update a game and its telling me I need to view my billing.i check my billing and it isn't giving me a none option. It's forcing me to put a credit card in, in order to update a game. Help please:(

    Well, that is probably becasue you owe a debt or something similar.
    Check with
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • I recently Updated my phone and my front camera stopped working its pitch black but still shows the icons on the screen but when i get off the app and get back on and flip the camera to my face view it works fine

    I recently Updated my phone and my front camera stopped working its pitch black but still shows the icons on the screen but when i get off the app and get back on and flip the camera to my face view it works fine

    Hi there Fgonzalez2015,
    You may find the camera troubleshooting steps in the article below helpful.
    Get help with the camera on your iPhone, iPad, or iPod touch
    You see a closed lens or black screen
    If you see a closed lens or black screen when you open the Camera app, try these steps:
    Make sure that there’s nothing blocking the camera lens. If you’re using a case, try removing it.
    Force the app to close, then open the Camera app again.
    Restart your device, then open the Camera app again.
    If your device has a front and rear camera, try both cameras by tapping the camera swap icon . If you see the closed lens or black screen on only one camera, take your device to an Apple Retail Store or Authorized Service Provider for more help.
    -Griff W.  

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • IPad2 update to iOS6 will no longer play UTube: All my favourites that were previously viewed and saved with my iPad2 will no longer play. They can't be played via Safari either SOLUTION PLEASE (buy iPad3 which solves the issue isn't an option)

    IPad2 has been updated to iOS6 and will no longer play UTube favourites. These are favourites that have been previously viewed on iPad2 therefore I know the device is capable of playing them. This upgrade is no longer allowing me to use the device for the reason I bought it.
    Apple, I'm feeling as though I've been conned.
    My mates iPad3 on iOS6 plays all the stuff my 2 will no longer play.
    UTube via safari won't play them, all Apps I've tried have the same problem, a red band stating this video can't be played on your device OR flash player required. Has anyone got a solution???? Please don't write stating you have the same problem, I just want solutions. Thanks

    https://itunes.apple.com/us/app/jasmine-youtube-client/id554937050?mt=8
    This app should solve your headache

  • I updated to ios6 and now I can't view my past purchases in the App Store

    Iv recently updated to IOS6 and I had to restore my phone now when I go to the App Store to view my past purchases to download some again it doesn't come up. Someone please help me. I don't remember half the apps I downloaded and I can't try to find them all.

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • I am getting 'blocked plug in' messages which prevent video views and webinars.  I have updated Adobe, but still get the message. What should I do?

    I am getting 'blocked plug in' messages which prevent video views and webinars.  I have updated Adobe, but still get the message. What should I do?

    OS X 10.6.8?
    Safari 6/7
    1. System Preferences >  Flash Player > Advanced >  Delete  All
         Press the "Delete All" button
         Install Adobe Flash Player.
        http://get.adobe.com/flashplayer/
        Follow the prompts.   Quit Safari.
        Restart computer. Relaunch Safari.
    2.  Allow  Plug-ins
        Safari > Preferences > Security
        Internet Plug-ins >  "Allow  plug-ins"
        Enable it.
        Press " Manage Website Settings" button for more options.
    3. Safari > Preferences > Privacy
        Press the button “ Remove All Website Data”.

  • Writing an sql script to query a calculation view  and an attribute view inside a calculation view

    Hi,
    I was trying to query a calculation view with sql , and as one of the input parameters i was trying to give a query over an attribute view
    So my sql will look like this
    SELECT * FROM "MyApp.calculation_views::GET_CHECKLIST_FOR_ACCOUNT"('PLACEHOLDER' = ('$$ACCOUNT_ID$$', '1','$$CHECKLIST_ID$$',' SELECT CHECKLIST_ID FROM "MyApp"."CHECKLIST_PRODUCTS" WHERE PRODUCT_ID = 5'));
    So as an input to $$CHECKLIST_ID$$   i wanted to give an id selected from checklist products table where products id is passed as an input
    but this is not working, i am getting syntax error at the $$CHECKLIST_ID$$ there i can only pass values like  $$CHECKLIST_ID$$, '1'
    Please help me to figure out which  is the correct syntax  i tried putting the sql statement to get the checklist_id in '' but it too didnot work

    I'm not sure you'll be able to do a SELECT subquery directly in the placeholder definition, but you can create another calc view (scripted) as a wrapper to your original calc view and use a scalar variable to pass the parameter over.
    Try this as the base code for your second calc view:
    var_id VARCHAR(10);
    BEGIN
         SELECT CHECKLIST_ID INTO :var_id FROM "MyApp"."CHECKLIST_PRODUCTS" WHERE PRODUCT_ID = 5;
         var_out = SELECT * FROM "MyApp.calculation_views::GET_CHECKLIST_FOR_ACCOUNT"
              (PLACEHOLDER."$$ACOUNT_ID" => 1, PLACEHOLDER."$$CHECKLIST_ID$$" => :var_id);
    END
    You could even create input parameters in the second Calc View for the Account Id & Product Id (which are currently hard coded in your code below).
    Best,
    Henrique.
    PS: avoid using SELECT * for the var_out in the scripted calc view. It's better, from a code maintenance perspective, to explicitly define the columns you're outputting.

Maybe you are looking for