Query and update the large result set

I do need to update 50,000 lines in the comic book. Because I can not load the set(50K) of any result in memory as I'm reading the rows per batch, 200 lines of each loop by incrementing fetchStart of the view object and then do a re - interview.

I think pointed out that time elapse for every loop slows down over time.

Here is the code snippet:

range final int = 200;
int fetchStart = 0;
fetchSize int = range;
int range = increment;
Boolean doFetch = true;
Product list = new ArrayList (range);
so that {(doFetch)
products = getProducts (fetchStart, fetchSize); view //Modifies with the fetchStart and the re object - interview.

fetchStart = index + 1;
increment = increment + range;

for (product p: products) {}
modify the product
updateProduct (p);
}
transaction.Commit ();
Products.Clear ();
}

Can I do so that I get at least each loop to have a time of constant treatment for ex every loop taking only 3 to 5 seconds to complete?
Currently, the time flow increases as the loop to continue processing the remaining records.

Thank you.

Frank is right with his suggestion. A pl/sql procedure or an sql update statement (if all updates are the same) is best for update several lines.

To clarify my last post:
a VO can have only a single mode of access at any given time. Don't forget that you can switch the mode during execution. Range paging allows you to browse on all lines of the VO, before only not as its name suggests. Memory consumption is different because access only to the front only holds the level lines in memory. If you browse (forward) the memory of the old lines is released (when gc sets in). Therefore forward only has the smallest memory footprint (from ADFbc point of view) and can be used to manipulate the games the same outline. Still a pl/sql procedure is faster and more often the best choice.

The workflow are:
1. use a VO in access mode forward only
2 run your query
3. use (vo.next ()) {...} to work on each line

If you use the pagination of range rather than forward only you are able to use vo.prev () and other methods of navigation on the vo.

Timo

Tags: Java

Similar Questions

  • Looping over a query and return of all result sets

    Hello

    I'm a loop on a query by passing a list of ID numbers, I want to be able to return all results as a result. How can I find all these results as a whole. Here's how I do it now:

    Wow, what a strange concept...
    How about first creating a complete listOfBooks and then by running the query of searchSelect only once?
    now what you're doing, starting with an empty list (listOfBooks), you add an element to it with each loop and run your searchSelect again and again on the expansion list, query by returning the same values as you are returned in the previous step more new.
    what you need to do is:
    (1) create your list of listOfBooks and fill with searchContents as query results. This will create your complete list of book IDs.
    (2) run your searchSelect of query only once with tblMaterials.MaterialID IN (' #listOfBooks # ').
    No loops, no. wasted the resources of the CPU and bandwidth...

  • How to dynamically access the SQLite result set?

    I want to dynamically access the SQLite result set. Since webworks does not support the "PRAGMA table_info (table_name); I save all newly created information tables in a single two-column table called schema. schema has two columns, table_name, and column_name.

    So I created a function to dynamically access the data in the table. I use the item = results.rows.item (i) and that the data access with item.column line.

    column is a variable that will receive the value of a schema representative of column_name. When I alert (column) I get the column_name is correct, but when I used item.column my results are "not defined".

    any advice on how to solve this issue.

    I managed to solve this issue. The solution is the following: the normal way to access the data of the variable item = results.rows.item (i) is item.column (where the column is the name of the column in the database table. To access the data dynamically, I Specifies a var col1 to assign different values in col1. I then access the data in the database using point [col1] hope that makes sense. If you need a further explanation contact me at [email protected]

  • JSON to the sql result set

    Hi all

    I have this requirement to convert the JSON format in the result set (with the lines and columns).

    is their in any case I can achieve this?

    I was able to successfully convert the sql result set in JSON format but difficult time to do the reverse.

    Flexibility:

    At some point, I expect the lines to return no more than 2 & about 50 columns maximum.

    Therefore, the JSON itself can be stored in varchar2 (4000) and not need to use CLOB. (If necessary to be passed as an argument to the function).

    Oracle version: 11.2.0.3

    Kind regards

    AAG

    There are at least the son on this site below:

    https://community.Oracle.com/thread/2505918

    https://community.Oracle.com/thread/3634280

    https://community.Oracle.com/thread/3557925

    https://community.Oracle.com/thread/2510292

  • in bulk accumulate in plsql and update the same table.

    Hello

    I use bulk collect and update the table that I use the slider. This table has nearly 1 million records. There will be problems with my code? Any help is greatly appreciated.

    DECLARE

    terminate_reason VARCHAR2 (1000);

    time_line NUMBER;

    limit_in NUMBER;

    CURSOR cur_violations IS

    SELECT * from abc_table;

    TYPE cur_abc_table_type IS TABLE OF cur_abc_table % ROWTYPE INDEX BY PLS_INTEGER;

    cur_abc_table_rec cur_abc_table_type;

    BEGIN

    limit_in: = 5000;

    OPEN cur_abc_table.

    LOOP

    Get the cur_abc_table COLLECT in BULK

    IN limit_in LIMIT cur_abc_table_rec;

    dbms_output.put_line ('new count is' | cur_abc_table_rec.count);

    WHEN OUTPUT cur_abc_table_rec.count = 0;

    BECAUSE me in 1... cur_abc_table_rec. Count

    LOOP

    time_line: = trunc (sysdate) - cur_abc_table_rec (i) .viol_date;

    IF (time_line > 1000)

    THEN

    terminate_reason: = 'NOTWELL. "

    ON THE OTHER

    terminate_reason: = 'PUSHED ';

    END IF;

    UPDATE abc_table v

    SET

    v.pers_terminate_reason = terminate_reason;

    END LOOP;

    END LOOP;

    COMMIT;

    CLOSE Cur_abc_table;

    EXCEPTION

    WHEN no_data_found THEN

    dbms_output.put_line ('no data is found in the selection' |) SQLERRM);

    WHILE OTHERS THEN

    dbms_output.put_line ('another error' |) SQLERRM);

    END;

    Thank you

    KK

    What happened when you tried? The sliders were ' for the update of "syntax, so there is no general problem update lines inside a loop of cursor.

    The big question you have, it is that the loop is completely and totally useless. What you can do in SQL, do in SQL - not to complicate things with PL/SQL that you don't need.

  • Only one Integrator for export csv to table and update the table?

    Hello
    I have a requirement where I need to create a single Integrator for export data in the CSV file into a custom oracle table and also use the same Integrator to download and update the custom table data. Is it possible to do this in a single Integrator.

    Thank you
    Kishore

    Yes you can do it.

    You must create a type of UPDATE metadata Integrator.

    First time:

    Custom table is empty.

    WEB ADI will download a blank Excel sheet. Copy the data from the CSV file and paste this Excel.Then download this file that will update the Integrator.

    A sample example is as follows:

    web_adi_pkg.main (param_1, param_2,... param_n)
    download_data;
    upload_data;

    Download data-> select query to download the data (select * from custom_table)
    Download the data-> insert into custom_table where NOT EXISTS (select 1 from custom_table where primary_key = primary_key_col_from_csv)
    update of custom_table where there are (select 1 from custom_table where primary_key = primary_key_col_from_csv)

    Please try above logic.

  • I use google search. When I click on a suggestion contained in the results tab of the search, I want it to open in a new tab and keep the search results in the original tab. How?

    For example, when I enter the search term "cabinets" and get a page/tab search results with suggestions such as Sears, JCPenney, or Amazon, I want to be able to click on Sears and open the Sears page in a new tab/page. I want to be able to close the tab to Sears and use the search results tab.

    Google offers a framework for this. What it does, it adds a HTML (target = "blank") statement to every result link, which causes Firefox to open in a new tab. If you uncheck the preference to divert new windows in new tabs, Firefox will then open the result in a new separate window.

    This preference is stored in a cookie, if you clear your Google cookies often, so you'll need to reset every time. You can do so here:

    https://www.Google.com/preferences

    (On this page, Google refers to a new window.)

  • Impossible to download and update the app on the iPhone 6 Plus

    Topic: impossible to download and update the app on my iPhone 6 Plus

    Turn off your device and turn it on again. If this does not help, sign out of your account and reconnect.

    In addition, you can try to reset your settings.

    • Press and hold the sleep/wake button
    • Press and hold the Home button
    • Press and hold both buttons until the display turns off and on again with the Apple logo on the subject.

    Alternatively, you can go to settings - general - reset - Reset all settings

  • Why is able to save and update the passwords for sites other than those of Blackboard FF?

    I am able to save and update passwords on other sites, but not on the Blackboard learn for my University. They force us to change our pw is from time to time, and I think I noticed it after that Blackboard did some updates to their site. It will always load autofill with my old account and password, but not update it. I deleted the password stored and tried to get FF to remember once again on my laptop, but it has not yet asked to save him. I'm guessing that there is a new code or a script for the journal in the procedure? Is there a manual way to enter and update the credentials stored?

    Hello, sites can specify that passwords should not be stored (however I do know that if this is the case on the page you are having problems with, since you did not specify which University it affects). as a way to get around this, you can use an addon like this: https://addons.mozilla.org/firefox/addon/remember-passwords

  • Error Windows Updates ' "lack of details: updates Windows has corrupted operating system." " "Needs a remastering and updates the resettlement".

    We bought my son an ACER laptop in May this year (2014) as a birthday present and (hopefull) for use
    University (he won a place).
    Yesterday, the laptop has stopped working and just turned off.
    We took it back to the Currys PC World store (2222 Liverpool Aintree Branch) to fix them.
    They decided that it was not a warranty issue and that: - (I quote)
    "The fault details: updates Windows has corrupted operating system." "Needs a remastering and updates the resettlement".
    I have this in writing.
    It cost my son, a student, £50 and is without his laptop when it nears its first round of reviews.
    I need your answer before deciding on my next step.
    We bought my son an ACER laptop in May this year (2014) as a birthday present and (hopefull) for use
    University (he did win a place)... Yesterday, the laptop has stopped working and just turned off.

    Buy you a Windows XP computer brand new in May of 2014, is that correct?

  • Is it possible to reset the date of the last virus and update the spyware definitions in XP?

    I have xpsp3.  I was looking at my calendar to find out what day of the week, an event that happens in November, and unfortunately I forgot to go back to the date of the day before I have updated the definitions of viruses and spyware on MSE.  Now, MSE think my latest definitions of viruses and spyware are obsolete, because they were supposed to be updated three months from now.  So my question is: is it possible to reset the date of the last virus and update the spyware definitions in XP?

    Correct the date on your computer. Remove the antivirus/malware product and reinstall.

    -OR-

    To restore before the update, use the system restore. Make sure the date is correct. Update.

    Tom Ferguson

  • Cannot install and update the apps store of windows 8

    Cannot install and update the apps store of windows 8. When I click the button install is not install only loadin. Plese help me.

    After trying all suggestions from several sites, I found that the problem is that the Firewall window must be running in order for the applications to install.   If you are running Windows 8 Pro, go to the desktop and click on "My computer" and double click on 'manage '.  In the window on the left side computer management, expand "Services and Applications".   Click on 'Services', in the Center window, scroll down to "Windows Firewall" right click on "Windows Firewall" and click "Properties".  If the Startup Type is "disabled", click to drop down and select "Automatic".  At this point, you can click on 'Start' under the service status.  Once the Windows Firewall is started, you should be able to start installing and or update your apps from the app store.

  • I can't have the option in menu to 13 items to work.  Any ideas?  I have already downloaded all the Templates menu and updated the software.  I never had this problem with 7 elements.

    I can't have the option in menu to 13 items to work.  Any ideas?  I have already downloaded all the Templates menu and updated the software.  I never had this problem with 7 elements.  With the help of 13 elements, I can successfully burn my movie on a disc (DVD) without menu.  The burning process is interrupted after that I added a menu.

    Rick

    First of all, please remove the stopper at the end of the content of the timeline. It is not necessary it and burn the causes of the problems.

    The main Menu marker should be OK, no similar problems as the stopper a.

    RTA

  • How to install and update the vm on linux systems tools and how to join an esxi host in domain

    How to install and update the vm on linux systems tools and how to join an esxi host in domain

    thanq very much boss

  • I'm trying to download the trial version for Acrobat DC edit PDF files, but when download initializes, it gets to 11%, gets stuck, then gives the message "request from Web Get failed. I canceled, downloaded the installer again and got the same result.  I'

    I'm trying to download the trial version for Acrobat DC edit PDF files, but when download initializes, it gets to 11%, gets stuck, then gives the message "request from Web Get failed. I canceled, downloaded the installer again and got the same result.  I'm on a PC running Windows 8. Any suggestions?

    Hiddm93421458,

    Restart your system and then try again to install Acrobat Reader DC using this link Download Adobe Acrobat free trial | Acrobat Pro DC.

    Let me know if the problem persists.

    Kind regards

    Nicos

Maybe you are looking for

  • I3-b080sa Pavilion: pavilion i3-b080sa battery

    What battery do need me for the Pavilion i3-b080sa?

  • Comment for Satellite P100-188 owners looking to buy Creative Audigy 2 ZS sound card

    I just bought a Creative Audigy 2 ZS sound card, which is excellent, much better than the piece of bad quality (in my opinion) of material that accompanies it. But I thought I'd find out other buyers from the perspective of this card that it heats up

  • Pavilion 23-b239: downgrade to Windows 7

    Hi all, I bought my mother a 23-b239 Pavilion all in one office.She can not just get used to Windows 8. I would really know if it is possible to downgrade to Windows 7, and if someone couldkindly tell me: A profile of my hardware informationWhere can

  • Tab shortcut in the shortcut properties

    The shortcut tab has mysteriously disappeared from my Vista 64 shortcut properties.  I right-click and 'properties' and information arrives, but the tab shortcut, isn't here.  Something must have happened recently to change but I can't imagine that.

  • For Windows 7 homegroup icon

    Hello So, I turned on my laptop today and saw that there is a new icon on my desktop.  It was for the residential group program.  I don't remember the icon being there just the night before when I went on my laptop.  I opened the program and left the