batch-size = 10 and loop into huge loop to get selected batc

Posted by mhtan88 on 16-Nov-2009 08:00

Hi all,

I have a problem. and the scenario is something like this:

I have a record with 3 Million records. and i have set my

batch-size = 10.  and i need to return only selected page (i_currentpage)

with return 10 records. due to i need to get the saverowid. i need to run h_dataset:fill().

then only u will be able to get the saverowid, else you won able to get saverowid.

but at the end due to 3Million records / 10. it need to loop very long and get the appserver

time out broken pipe error. below is my code.  hope you all can help. thank you.

DO i_temp = 1 to pd_temp:

     if saverowid NE ? then do:

          h_datasource:restart-rowid = saverowid.

     end.

     h_dataset:empty-dataset.

     h_dataset:fill().

     if not h_temptable:default-buffer-handle:last-batch then do:

          saverowid = h_datasource:next-rowid.

     end.

     else do:

          saverowid = ?.

     end.

    

     if i_temp = i_currentpage then do:

          h_temptable:tracking-changes = true.

          leave.

     end.

end.

Regards,

TanMH

All Replies

Posted by Håvard Danielsen on 16-Nov-2009 11:55

For paged batch solutions you should use restart-row instead of restart-rowid. The restart-row takes an integer that specifies the absolute row to start filling the data. If the request is for a particular page you just calculate the restart-row from the batchsize.    

Posted by mhtan88 on 16-Nov-2009 18:43

hi havard,

Thank you. sorry, i have left out to mention I'm using 10.0B03.  and I think this restart-row is only available on higher version.  can progress come out the "service pack" to patch particular

10.0B to have restart-row?  But, your information may help me in the future.

by the way, what is the meaning of restart-rowid(n) ?  the n is the number. is it represent num page?

Thank you.

Regards,

TanMH

Posted by Admin on 16-Nov-2009 23:11

Thank you. sorry, i have left out to mention I'm using 10.0B03.  and I think this

restart-row is only available on higher version.  can progress come out the "service

pack" to patch particular 10.0B to have restart-row

10.0B is a historic OpenEdge release right now (more than 5 years old). Even 10.1C is retired since a couple of weeks. The current OE release is 10.2A. Don't expect service packs for any other release. And normally major new functionality should only be added in a release, not a service pack.

What's stopping you from updating?

 

by the way, what is the meaning of restart-rowid(n) ?  the n is the number. is it represent num page?

 

A DATA-SOURCE object can be associated with more than one buffer. So (n) specifies the Index of the buffer. It's not required when there is only a single buffer with that DATA-SOURCE. Alternatively you may specify the buffers name (RESTART-ROWID ("eCustomer")). But I don't find that very practical, as usually I needed some sort of automation here and DO i = 1 TO hDataSource:NUM-SOURCE-BUFFFERS is easiest.

Posted by lauth on 16-Nov-2009 23:29

Hi Mike,

10.0B is a historic OpenEdge release right now (more than 5 years old). Even 10.1C is retired since a couple of weeks. The current OE release is 10.2A. Don't expect service packs for any other release. And normally major new functionality should only be added in a release, not a service pack.

What's stopping you from updating?


     We have 10.1A But, OpenEdge seems like make their openEdge version into variance "Pattern" and there are big different. due to some major program already developed 10.0B, and all GUI already in ICFDB.  if changed to 10.1A. can we still run like 10.0B using ICFDB 's GUI but back end using 10.1A by using Dynamic Configuration tool to migrate? it seems like development pattern have to change.

    

A DATA-SOURCE object can be associated with more than one buffer. So (n) specifies the Index of the buffer. It's not required when there is only a single buffer with that DATA-SOURCE. Alternatively you may specify the buffers name (RESTART-ROWID ("eCustomer")). But I don't find that very practical, as usually I needed some sort of automation here and DO i = 1 TO hDataSource:NUM-SOURCE-BUFFFERS is easiest.

Understood.  Thank you very much.

Thank you.

Regards,

TanMH

Posted by Admin on 17-Nov-2009 00:41

There have been some difficulties with some upgrades of the ICFDB... But still you can use the 10.0B or 10.1A version of Dynamics with a version 10.2A of Progress. And suddenly you'd be on a supported release of OpenEdge and be able to leverage the latest language features.

You should open a separate thread if you want to discuss how to run 10.1A Dynamics on 10.2A or your migration experience. With Peter Judge and Havard Danielsen two of the Dynamics developers are very active on this forum and I'm pretty sure they can help with that. I've got also some Dynamics experience my own.

Posted by Peter Judge on 17-Nov-2009 07:46

We have 10.1A But, OpenEdge seems like make their openEdge version into

variance "Pattern" and there are big different. due to some major program

already developed 10.0B, and all GUI already in ICFDB. if changed to 10.1A.

can we still run like 10.0B using ICFDB 's GUI but back end using 10.1A by

using Dynamic Configuration tool to migrate? it seems like development

pattern have to change.

You can run Dynamics without trouble in current versions (this is one of the great things about OpenEdge - the backwards compatibility). You'll need to migrate (as opposed to upgrade) from 10.0B. There are instructions in the release notes on how to do this.

We have 10.1A But, OpenEdge seems like make their openEdge version into

variance "Pattern" and there are big different

Not 100% sure what you mean by this, but ABL GUIs (ie .w's) will run fine on current versions. There's nothing from the ABL side requiring you to use the GUI for .NET.

-- peter

Posted by Håvard Danielsen on 17-Nov-2009 10:23

Thank you. sorry, i have left out to mention I'm using 10.0B03.  and I think this restart-row is only available on higher version.


You can support paging by opening the datasource query and use reposition-to-row to position to the desired page and then set the restart-rowid from the table. 

myQuery:query-open().

myQuery:reposition-to-row(200000).

myQuery:get-next().

myDatasource:restart-rowid = rowid(mydbtable).

This is not exactly the same as using the new restart-row, since the query need to reposition twice, to the row and then to the rowid. The position to rowid will not be noticeable if the query benefits from indexed-reposition, but could possibly take the same time as the repostion to row if it is not.

Posted by mhtan88 on 17-Nov-2009 21:34

hi Havard,

Thank you!!! finally solved my problem on return last row record with few million records.

Thank you.

Regards,

T@nMH

This thread is closed