Paging mechanism

Hi friends
what is the best way to implement a paging mechanism in an application using servlets/jsp
Anyone who have done this , please advise
TIA

There are 4 ways
1. If database supports limit like SQLServer supports top keyword and MySQL supports Limit keyword(The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments).
2. You can store all the rows in a data structure and by using 1 or 2 variables you can get data from this data structure. Put this data structure in session.
3. You can implement paging logic in method that is fetching records from db, mean dont store all records in data structure and session. Just skip records in RecordSet that are not required. And return required records to JSP. In this way you need to fetch all the records from db on every request of page. But you dont need to make your session heavy and u will always get updated data. In case of session you will get old data.
4. There are tag libraries available on the net, you can use them for paging.
I hope you got the idea...............

Similar Messages

  • Paging mechanism in EJB

    I am trying to improve the performance of a huge report (around 80,000) records. The application uses stateless session bean and it fetches the records in a loop one at a time. I want to change it in such a way it uses oracle stored procedure that fetches 1000 records at a time. When a user wants to see the next set of 1000 records he/she should be able to see by clicking on a link. I�m pretty new to EJB. Before even I proceed I want to make sure that if I am taking the right approach. Now my question is, can I implement Paging mechanism in EJB. If so how feasible it is? Is there any other better way to do it?

    hey how are you. I use following paging mechnism. There is paging method, which generates paging links.
    public PagingInfo paging (String baseUrl , String currentPage , Long totalItems , Integer itemsPerPage)
              Integer cPage = getInteger (currentPage) ; // if currentPage is valid Integer, return Integer value, else returns null
              if (cPage == null || cPage < 1)
                   cPage = 1 ;
              Long totalPages = 1L ;
              Integer i ;
              while (totalPages * itemsPerPage < totalItems)
                   totalPages ++ ;
              Integer start = (cPage - 1) *  itemsPerPage ;
              if (baseUrl.lastIndexOf("?") == -1)
                   baseUrl = baseUrl.concat("?") ;
              else
                   baseUrl = baseUrl.concat("&") ;
              String output = "" ;
              if (totalPages > 1)
                   List <String> pages = new ArrayList <String> () ;
                   if (cPage > 1)
                        pages.add (li (link (baseUrl + "page=" + (cPage - 1) , "previous page"))) ;
                   for (i = 1 ; i <= totalPages ; i ++)
                        if (cPage.equals(i))
                             pages.add (li (String.valueOf(cPage))) ;
                        else
                             pages.add (li (link (baseUrl + "page=" + i , String.valueOf(i)))) ;
                   if (cPage < totalPages)
                        pages.add (li (link (baseUrl + "page=" + (cPage + 1) , "next page"))) ;
                   Integer size = new Integer (pages.size()) ;
                   for (i = 0 ; i < size ; i ++)
                        output = output.concat(pages.get(i)) ;
                   output = div (ul (output) , "pages") ;
              return new PagingInfo (start , itemsPerPage , cPage , output) ;
         }PagingInfo declared like this :
    public class PagingInfo {
         Integer start ;
         Integer itemsPerPage ;
         Integer currentPage ;
         String output ;
         public Integer getStart() {
              return start;
         public Integer getItemsPerPage() {
              return itemsPerPage;
         public Integer getCurrentPage() {
              return currentPage;
         public String getOutput() {
              return output;
         public PagingInfo(Integer start, Integer itemsPerPage, Integer currentPage,
                   String output) {
              this.start = start;
              this.itemsPerPage = itemsPerPage;
              this.currentPage = currentPage;
              this.output = output;
         public PagingInfo() {}
    }And your code should be like this
    PagingInfo pi = paging ("servletname?action=view" , request.getParameter ("page") , itemCount , itemsPerPage) ;
    Query ejbQuery = manager.createQuery("SELECT d FROM DataTable d");
    ejbQuery.setMaxResults (pi.getItemsPerPage ()) ;
    ejbQuery.setFirstResult (pi.getStart ()) ;
    List result = ejbQuery.getResultList();
    out.print (pi.getOutput ()) ; // paging links
    while ()
    // printing your item list
    out.print (pi.getOutput()) ; // paging links

  • Paging with JDBC

    Hi
    What is the best way to do paging with JDBC when using PL/SQL Cursor. I want to create DAOs that access PL/SQL Cursors with a paging mechanism. The DAO must be stateless.
    Regards,
    Nestor Boscan

    Nestor,
    While I'm not trying to take away from Mikael's suggestion, the way I do it (which was implemented before the existence of "OracleCachedRowSet") is to maintain a scrollable "ResultSet" on the server, and send "Collection"s to the client. But beware of very large "ResultSet"s, because the Oracle JDBC driver implements scrollable "ResultSet"s via client memory.
    In any case, paging has been discussed previously in this forum. Did you try searching the forum archives?
    Good Luck,
    Avi.

  • Flex mobile paged list troubles with destructionPolicy

    Hello,
    i have set a list with data paging in a flex mobile view with destructionPolicy=never, when coming back to this view i get some errors when the paging mechanism is triggered (there is no errors when all of the items were previously fetched).
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.data::RPCDataServiceAdapter/http://www.adobe.com/2006/flex/mx/internal::addPagingParameters()[C:\depot\DataServices\br anches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as :1108]
    at mx.data::RPCDataServiceAdapter/pageQuery()[C:\depot\DataServices\branches\milestone\lcds4 5_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:411]
    at mx.data::RPCDataServiceAdapter/processDataMessage()[C:\depot\DataServices\branches\milest one\lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1069]
    at RPCDataServiceRequest/invoke()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frame works\projects\data\src\mx\data\RPCDataServiceAdapter.as:1786]
    at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\depot\DataServices\branches\milest one\lcds45_fb45\frameworks\projects\data\src\mx\data\DataStore.as:3497]
    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\pr ojects\data\src\mx\data\DataStore.as:1716]
    at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::fill()[C:\depot\DataServices\branches\mileston e\lcds45_fb45\frameworks\projects\data\src\mx\data\DataStore.as:1767]
    at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::processPageRequest()[C:\depot\DataServices\bra nches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataStore.as:1854]
    at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::processPageRequest()[C:\depot\DataServices\bra nches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\ConcreteDataService.as:50 35]
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::requestItemAt()[C:\depot\DataServices\branches \milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataList.as:1201]
    at mx.data::DataList/getItemAt()[C:\depot\DataServices\branches\milestone\lcds45_fb45\framew orks\projects\data\src\mx\data\DataList.as:364]
    at mx.collections::ListCollectionView/getItemAt()[E:\dev\4.5.1\frameworks\projects\framework \src\mx\collections\ListCollectionView.as:511]
    at mx.collections::AsyncListView/getItemAt()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\collections\AsyncListView.as:701]
    at spark.components::DataGroup/getVirtualElementAt()[E:\dev\4.5.1\frameworks\projects\spark\ src\spark\components\DataGroup.as:1446]
    at spark.layouts::VerticalLayout/updateDisplayListVirtual()[E:\dev\4.5.1\frameworks\projects \spark\src\spark\layouts\VerticalLayout.as:1807]
    at spark.layouts::VerticalLayout/updateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\ src\spark\layouts\VerticalLayout.as:2105]
    at spark.components.supportClasses::GroupBase/updateDisplayList()[E:\dev\4.5.1\frameworks\pr ojects\spark\src\spark\components\supportClasses\GroupBase.as:1294]
    at spark.components::DataGroup/updateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\sr c\spark\components\DataGroup.as:1373]
    at mx.core::UIComponent/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framework\src \mx\core\UIComponent.as:8989]
    at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:736]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:819]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
    is there any way to prevent this ?

    Nobody any idea?
    i tried it like its described in this article:
    Declaring file type associations
    http://livedocs.adobe.com/flex/3/html/help.html?content=File_formats_1.html
    but i can't get it running for my mobile project. The  type associations works fine in my desktop air application but it doesn't work in my mobile app. Is this  type associations stuff supposed to be working on mobile devices / android?

  • LCDS and paging

    Hello everybody,
    First, excuse me for the mistakes I may have made.
    I am a trainee and the enterprise I work for is planning to
    change the presentation layer (and maybe all the layers) of their
    software packages for Flex (at the present time they use the .NET
    platform). But in order to ensure that Flex can answer their needs,
    they have asked me to make a model using Flex together with Java,
    Hibernate, LCDS, SQL Server and Tomcat.
    I am currently using those versions :
    - jdk 1.5.0_12
    - Hibernate 3 (I use the jars provided with LCDS)
    - LCDS 2.5
    - SQL Server 2005
    - Tomcat 5.5
    As far as some of the tables from their databases are quite
    big (they can reach 2.000.000 rows) I need to implement paging. The
    table I currently use for my example is "only" 10.000 rows.
    I must confess that I am new to n-tiers architectures and
    that there are many concepts I misunderstand.
    What I want to do is make the user able to choose how many
    rows a page he wants to display (This could look a bit like
    this). And
    the server would only send this number of rows for each page (which
    is not the case for the page I linked).
    I have noticed that the implementation of the fill method for
    the HibernateAssembler had changed between FDS (
    public Collection fill(List fillArgs)) and LCDS (
    public Collection fill(List fillArgs, int startIndex, int
    numItems)).
    You are now able to specify a start index and the number of
    rows to display. This is the method I would like to use.
    To do so, I have tried to refer to
    LCDS
    documentation but I find it quite confusing. Here it is :
    Using on-demand paging
    There are two ways in which the Data Management Service
    implements on-demand paging of data by Flex clients. In the default
    approach, the fill method returns the entire collection of objects.
    The server sends the first page of items to the client as part of
    the initial fill request.
    As the client code tries to access ArrayCollection elements
    which are not resident, additional pages are retrieved from the
    server. If the cache-items property is set to true, these pages are
    sent directly by the Data Management Service. If the cache-items
    property is set to false, the Data Management Service calls the
    getItem() method for each item it needs to send to the client.
    When the original query is too large to be held in the
    server's memory, it is desirable for the Assembler to only return a
    single page of items at a time. In this mode, each time the client
    requests a page, the Assembler is asked for that page of items and
    they are sent directly to the client. Currently this mode is not
    supported when the autoSyncEnabled property is set to true for the
    paged collection. You must set the autoSyncEnabled property to
    false before executing the code. This configuration is not
    supported for the SQLAssembler. It is supported for the
    HibernateAssembler and you can implement it with your own Java
    Assembler implementation.
    To enable this second mode, you set the custom="true"
    attribute on the paging element in your network settings on the
    server and ensure paging is enabled with a reasonable pageSize
    value.
    If you are using the fill-method approach in your Assembler,
    you specify a fill method that matches the fill parameters used by
    your client with two additional parameters: the startIndex and the
    number of items requested. The Data Management Service calls this
    method once for each page requested by the client.
    If you are using the Assembler interface approach, you
    override the useFillPage() method for the appropriate fill method
    to return true for the fill parameters you want paged using custom
    paging. When the client requests a page, it calls the fill variant
    in the Assembler interface which takes the additional startIndex
    and number of items parameters. You return
    just those items and they are returned to the client.
    When you use custom paging in either the fill-method or
    Assembler approach, there are two ways that the client can
    determine the size of the collection. When you have enabled the
    custom paging mode, on the initial fill request made by the client,
    the Data Management Service invokes the count method with the
    parameters the client passed to fill. If the count
    method returns -1, a dynamic sizing algorithm is used for
    this filled collection. In this approach, the assembler's paged
    fill method is called with startIndex of 0 and number of items set
    to the pageSize + 1. If the assembler method returns less than the
    number requested, the size of the fill is known. If it returns the
    pageSize+1 items requested, pageSize items are
    returned to the client but the client sets the collection
    size to pageSize + 1 - with one empty slot at the end. When that
    empty item is requested by the client, the next pageSize+1 items
    are requested and the process repeats until the assembler returns
    less than pageSize+1 items.
    The HibernateAssembler implements this dynamic paging
    mechanism when you set the page-queries-from-database attribute to
    true in the destination's server properties. If you are using an
    HQL query sent from the client and the query is a simple query, the
    Hibernate assembler attempts to implement a count query by
    modifying the query sent from the client.
    If you are using a named query, the Hibernate assembler looks
    for a query named <original-query-name>.count. If that query
    exists, it uses it to compute the size of the paged collection.
    Otherwise, it uses the dynamic-sized approach.
    I guess I should change
    <params>java.util.List</params> for
    <params>java.util.List,int,int</params>.
    But I don't know which properties to add or modify.
    It also talks about the custom attribute of the paging
    element. Is it a new attribute that replaces "enabled" ? Or does it
    come in addition to it ?
    The following files are working and allow me to retrieve the
    datas I expect (but without paging).
    My data-management-config.xml looks like this :
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="data-service" class="flex.data.DataService"
    messageTypes="flex.data.messages.DataMessage">
    <adapters>
    ....<adapter-definition id="java-adapter"
    class="flex.data.adapters.JavaAdapter" default="true"/>
    </adapters>
    <default-channels>
    ....<channel ref="my-rtmp"/>
    </default-channels>
    <destination id="refacteur.hibernate">
    ....<adapter ref="java-adapter" />
    ....<properties>
    ........<use-transactions>true</use-transactions>
    ........<source>flex.data.assemblers.HibernateAssembler</source>
    ........<scope>application</scope>
    ........<metadata>
    ............<identity property="cleacteur"/>
    ........</metadata>
    ........<network>
    ............<session-timeout>20</session-timeout>
    ............<paging enabled="false" pageSize="20"/>
    ............<throttle-inbound policy="ERROR"
    max-frequency="500"/>
    ............<throttle-outbound policy="REPLACE"
    max-frequency="500"/>
    ........</network>
    ........<server>
    ............<hibernate-entity>fr.phylum.referentiel.Refacteur</hibernate-entity>
    ............<fill-method>
    ................<name>fill</name>
    ................<params>java.util.List</params>
    ............</fill-method>
    ............<fill-configuration>
    ................<use-query-cache>true</use-query-cache>
    ................<allow-hql-queries>true</allow-hql-queries>
    ............</fill-configuration>
    ........</server>
    ....</properties>
    </destination>
    </service>
    This is the named query definition I use, found in
    Refacteur.hbm.xml :
    <query name="refacteur.where.ville.order.by.libacteur">
    ....<![CDATA[
    ........from Refacteur as refacteur
    ........where refacteur.villeActeur = ?
    ........order by libacteur
    ....]]>
    </query>
    And here is the call to the fill method, found in my mxml
    application file Acteurs.mxml :
    globalFilter.dataService.fill(globalFilter.arrayCollection,
    "refacteur.where.ville.order.by.libacteur", ["VANNES"]);
    I have tried to modify several things, but nothing works.
    I would be most grateful if someone could tell me what to
    change in my files in order to make the paging work.
    Nathalie.

    Have you seen the part of the example configs where it talks
    about what is required for data paging to work?
    <!--
    Indicates whether data paging is enabled for the destination
    and if you wish to override the
    pageSize set for the channel.
    Setting the custom flag to true indicates that the
    associated assembler has a paged-fill method
    corresponding to each method specified via the
    <fill-mathod> tag. The paged-fill method
    should have two additional java.lang.Integer params at the
    end of the parameters specified
    via the <params> tag. The first param specifes the
    index in the fill collection from which this
    method will start retrieving records. And the second param
    specifies the number of records to be
    retrieved by each paged-fill call.
    Default enabled value is false. Default pageSize value is
    10. Default custom value is false.
    <paging enabled="true" pageSize="5" custom="true"/>
    -->
    It seems to imply to me that you need the paged fill methods
    in your config in addition to the regular ones.
    I admit I have not got as far as getting a working paging
    setup yet, although this is something I will need to get working in
    the near future.

  • Want to sort tables inside a complex mechanism, what can be the approac

    I have a situation where first we are fecthing some ids(list of say version ids using hibernate form database)
    then keeping those list of data in a Pager Object(Paging mechanism displays 100 rows per page out of complete sa 100 or so.)
    This pager class does two things one takes whole list of ids (Collection of version_id).
    (Every time based on search criteria it changes. For searching in hibernate values are hardcoded. Want modification with minimal changes as many things are interrelated here.)
    and other thing it checks no. of contents based on that displays data per page(100 here).
    It means stores all data from database and send it oage by page.(First thing to notice)
    Next all this is getting stored in Report page where it searches other column names based on ids(version_id) the other column names are getting changed for different requests so what we do is take all other columns collectAllExtraFields(this is also getting changed everytime based on what is getting searched.)
    Now all this is getting accumulated while displaying but as we know what to display we hardcoded all fields required to display based on search. But all fields are searched based on the id fetched from database first time which Pages is storing.
    like this
    Search for product user information & retrun results in the form of a paged table for components used by specific product
    ComponentVersion versionObj = versionHandler.getComponentVersion(versionId);
    String CAUsers = ctHelp.getCAUsersSection(versionId);
    tableBody = tableBody + ((i%2 == 0) ? "<tr class='table_banded_row' valign='top'>" : "<tr class='table_row' valign='top'>");
    tableBody = tableBody + "<td class='table_data'>" +
    procHelper.getCompVersionLink(versionId, versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
    tableBody = tableBody + "<td class='table_data'>" +
    CAUsers + "</td>";
    tableBody = tableBody + "<td class='table_data'><span class='data'>" +
    versionObj.getComponent().getType() + "</span></td>";
    tableBody = tableBody + "<td class='table_data'><span class='data'>" +
    versionObj.getComponent().getVendor() + "</span></td>";
    tableBody = tableBody + "<td class='table_data'><span class='data'>" +
    versionObj.getRecommendationType() + "</span></td>";
    tableBody = tableBody + "</tr>";
    /** Get ComponentVersion ID with hyperlink to ComponentVersion Detail page
    public String getCompVersionLink(long versionId, String compName, String compVersion){
    return "<a class='datalink' title='" + this.getComponentFlyOverText(versionId) + "' href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId=" + versionId + "'>" + compName + "  " + compVersion + "</a>";
    this is getting called by Report.jsp to display.
    As this is getting changed everytime its called form classes not used in jsp directly i think.
    Now original objective is to sort all these displayed columns.
    If user clicks on any of the column name everything sholud get sorted on that basis.but sholud not call databse for same again by using same id and mapping with any new column name this sholud be done. Paging mechinasm to be used as it is if possible without major changes.
    i don't know where to start with as started looking on this code just 2-3 days back only.
    Vj

    Sorting and paging - two separate issues. Tackle them separately.
    Sounds like you've given yourself a problem by embedding all this logic in the JSP itself. That makes a mess. If you had a front controller servlet that could help you out that would make the page easier.
    I think your difficulties are caused by a bad design.
    Do your sorting by putting data structures into request scope on the page and make the sort requests back to the page itself. Rearrange the data, then display.
    The paging issue is separate. Set the fetch size and have a server-side component that helps with the paging.
    %

  • Want to sort tables inside a complex mechanism, what can be the approach?

    I have a situation where first we are fecthing some ids(list of say version ids using hibernate form database)
    then keeping those list of data in a Pager Object(Paging mechanism displays 100 rows per page out of complete sa 100 or so.)
    This pager class does two things one takes whole list of ids (Collection of version_id).
    (Every time based on search criteria it changes. For searching in hibernate values are hardcoded. Want modification with minimal changes as many things are interrelated here.)
    and other thing it checks no. of contents based on that displays data per page(100 here).
    It means stores all data from database and send it oage by page.(First thing to notice)
    Next all this is getting stored in Report page where it searches other column names based on ids(version_id) the other column names are getting changed for different requests so what we do is take all other columns collectAllExtraFields(this is also getting changed everytime based on what is getting searched.)
    Now all this is getting accumulated while displaying but as we know what to display we hardcoded all fields required to display based on search. But all fields are searched based on the id fetched from database first time which Pages is storing.
    like this
    Search for product user information & retrun results in the form of a paged table for components used by specific product
    ComponentVersion versionObj = versionHandler.getComponentVersion(versionId);
    String CAUsers = ctHelp.getCAUsersSection(versionId);
    tableBody = tableBody + ((i%2 == 0) ? "<tr class='table_banded_row' valign='top'>" : "<tr class='table_row' valign='top'>");
    tableBody = tableBody + "<td class='table_data'>" +
    procHelper.getCompVersionLink(versionId, versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
    tableBody = tableBody + "<td class='table_data'>" +
    CAUsers + "</td>";
    tableBody = tableBody + "<td class='table_data'><span class='data'>" +
    versionObj.getComponent().getType() + "</span></td>";
    tableBody = tableBody + "<td class='table_data'><span class='data'>" +
    versionObj.getComponent().getVendor() + "</span></td>";
    tableBody = tableBody + "<td class='table_data'><span class='data'>" +
    versionObj.getRecommendationType() + "</span></td>";
    tableBody = tableBody + "</tr>";
    /** Get ComponentVersion ID with hyperlink to ComponentVersion Detail page
    public String getCompVersionLink(long versionId, String compName, String compVersion){
    return "<a class='datalink' title='" + this.getComponentFlyOverText(versionId) + "' href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId=" + versionId + "'>" + compName + "  " + compVersion + "</a>";
    this is getting called by Report.jsp to display.
    As this is getting changed everytime its called form classes not used in jsp directly i think.
    Now original objective is to sort all these displayed columns.
    If user clicks on any of the column name everything sholud get sorted on that basis.but sholud not call databse for same again by using same id and mapping with any new column name this sholud be done. Paging mechinasm to be used as it is if possible without major changes.
    i don't know where to start with as started looking on this code just 2-3 days back only.
    Vj

    Sorting and paging - two separate issues. Tackle them separately.
    Sounds like you've given yourself a problem by embedding all this logic in the JSP itself. That makes a mess. If you had a front controller servlet that could help you out that would make the page easier.
    I think your difficulties are caused by a bad design.
    Do your sorting by putting data structures into request scope on the page and make the sort requests back to the page itself. Rearrange the data, then display.
    The paging issue is separate. Set the fetch size and have a server-side component that helps with the paging.
    %

  • Server side paging hughe tables.

    Hi,
    If I want to do a findAll () on a serious big table (million records), I need a paging mechanism, to avoid an out of memory exception.
    This table has a primary key consisting of one (String) field, so no complex stuff there. Is there any easy way to do this with ejbql? I'm using weblogic 6 as the application server.
    Cheers.

    forget about ejbql...
    ejbql is not good solution for big table
    use fast lane pattern, and directly access database.
    This is oracle example.
    oracle hint and inline view and good index is key point.
           String query= "select "+REQUEST_LIST_SELECT+" from "+TABLE_SERVICE_REQUEST +","+
                    " (select /*+ INDEX_DESC("+TABLE_SERVICE_REQUEST+" "+INDEX_SERVICE_REQUEST+")*/ "+
                    "  ROWNUM NUM,SERVICE_CODE from "+TABLE_SERVICE_REQUEST+
                    " where ROWNUM<="+(offset+numberPerPage)+
                        getServiceRequestWhere(searchStart,searchEnd,keyward)+
                    " ) indexer "+
                    " where NUM>"+offset+" and indexer.SERVICE_CODE="+TABLE_SERVICE_REQUEST+".SERVICE_CODE "+
                    " order by SERVICE_CODE desc";

  • Performance degraded with VirtualListView control

    Hi,
    We are using VirtualListView control for retrieving LDAP entries from SunOne directory server. We observed that with VirtualListView control, search performance degraded considerabaly (almost down by 95%) as compared to retrieving same result without using Paging mechanism.
    We have configured the directory server for better performance. Also added the index on attributes which we are retrieving using search operation. But still performance is very bad. Does any one has faced this issue earlier? Are there any settings which we can use to improve the performance?
    We do not want to retrieve all records without using paging to avoid any memory issue.
    Thanks,
    Kiran

    "Do i need to some setting adjustments ?"Probably not.
    "The performace degraded drastically."Could you elaborate a bit more please? Could you give an example please?
    /r

  • Working with VERY LARGE tables - is it possible to bypass row counting?

    Hello!
    For working with large result sets ADF provides the `Range Paging` mechanism for views, described in the 27.1.5 part of the Developer’s Guide For Forms/4GL Developers.
    It works well, but as a common mode it counts total row count to allow paging. In some cases query `select count(1) from (SELECT ...)...` can take very, very long time.
    But if a view object doesn't know row count (for example we can override getEstimatedRowCount() method ), paging controls doesn't appear in user interface.
    Meanwhile I suggest that it's possible to display two paging links - Prev and Next, without knowing row count. Is it a way to do it?
    Thank in advance,
    Ilya Rodionov.

    Hi Ilya,
    while you wait for Franks to dig up the right sample you can read this thread:
    Re: ADF BC: Performance issue with getEstimatedRowCount (ER?)
    There we discuss the exact issue.
    Timo

  • Equivalent of alloc_oages in solaris 10

    Hi All,
    Currently iam porting my linux 10 gig network driver into solaris .
    I have a question regarding Memory allocation ,
    1. For performance tuning we directly allocate pages in linux
    ( using alloc_pages) and just unmap them ( using pci_umap)
    Is there any equivalent in solaris .
    2. Is there any sample driver which implemented this paging
    mechanism .
    Ramya

    Thank you alan
    even after setting the max file descriptor to 8192, the output from pfiles show as 4096
    Current rlimit: 4096 file descriptors
    would you know if there is something wrong with the command which i am using - projmod -s -K 'process.max-file-descriptor=(basic,8192,deny)' PROJECTNAME( I am issuing this command as root)
    thank you
    Jonu Joy

  • How do I set a ui:table to Page 0 every time its rendered?

    Seems that the paging mechanism in my tables retain the page that
    was last selected.
    I would like them to always start at page 0.

    This is the first difference, my Search page just
    loads a data array and
    puts that into Session so that the Master page can
    display it after the use
    selects a Search button, which takes them to the
    Master page.Both your project and my project use the search page
    to determine the subset of data to display. While we
    do it differently, I do not think this interferes
    with the table component's paging mechanism. To be
    safe, when I have time, I will recreate with your
    scenario, but I would be surprised if that made a
    difference.
    Are you trying to say that on the Search page I
    should call the DataProvider
    .cursorFirst() method? No,
    If so that is not yet
    available until I get to the Master
    page.
    age2 (master page)
    o Add table bound to TRIP
    o Modified trip row set's query to add querycriteria
    for PERSONID
    o Added button
    o Prerender's code is
            try {
    etSessionBean1().getTripRowSet().setObject(1,
    (Object) getRequestBean1().getPersonId());
    tripDataProvider.refresh();
    tch (Exception e) {
    log("cannot show trips");
    ode]So on the Master page I have a ui:table with the
    first column being a RadioButton that the user
    selects. The user then selects a Detail button
    to take them to the Detail page.
    In the Master page's prerender method I've added
    memberSummaryDataProvider.cursorFirst();
    //memberSummaryDataProvider.refresh(); NO SUCH
    METHOD
    tableRowGroup1.setFirst(0);In your scenario, a call to setFirst(0) should not be
    necessary. This is only necessary if you have the
    search mechanism on the same page as the table. I
    appologize for leading you down the wrong path. No problem.
    >
    You should be able to remove this.Done.
    >
    >
    As I stated above nothing is preselected on the
    Master page's ui:table.Same with mine
    I go Search->Master (goto to Page3)->Detail->Search
    (with different
    search criteria which in turn generates adifferent
    data array)->Master
    (know the ui:table is at Page 3 and not at Page 1
    which is the BUG.
    Thanks you for your help. I just don't understandwhy
    the ui:table is set
    to Page 3 the second time I do a search.Me neither. On this page
    (http://developers.sun.com/prodtech/javatools/jscreato
    r/learning/tutorials/index.jsp) is a Creator docs
    feedback alias. Perhaps you can zip up your project
    (do a clean first) and send it to the alias with
    "for chris" in the subject line.Thanks, unfortunately my project is already about 100 pages. It would
    take me some time to trim it down to a minimum that you could look at.
    >
    >>
    Perhaps I should be asking; What is thealternative
    to refresh() for an
    ObjectArrayDataProvider?You don't need it in your case.Understood.
    Out of curiosity, does the ui:table use a VirtualForm that I'm not aware of?
    If so what would that VirtualForms name be? I'm thinking of trying
    to call discardSubmittedValues("virtualformname"). I've had some success
    in solving other problems that are related to old values being retained
    on other pages.
    Just curious, and thanks for your help Chris.

  • PAGINATION IN DATAGRID

    actually i am reading data from xml and puttin that data in datagrid
    in the xml there is many Heading and in each Heading there is 10 or 15 data.
    i want each Heading in a new datagrid page with all data and below of that datagrid there is next-previous button
    on clicking of next button it will go to next page like our discussion page of adobe forum and also on clicking previous button it wil come 2 previous page

    Consider the DataGrid a "dumb" display that for the most part that displays the data bound to it from some data model object. The data model object should be responsible for handling the paging mechanism which could be triggered by some other controls such as buttons. It could either filter a larger set that it gets all at once or query the server as needed.

  • Using a database as the table model for a large JTable

    I have a swing application with a Jxtable (Jtable with extra features from swingx project) that displays the details of music files, album, artist ... . The data model is held in memory and unfortunately because there are 70 different columns and users a re tyrying to load their complete music collection (e.g 100,000 files) I am having memory issues.
    I am now considering backing the data with a database and possibly using Hibernate. Do you think this is feasible or would it run too slowly, has anybody done this ?
    The first issue is whether rows can be retrieved quickly enough as a user scrolls down a table , I thinking that if I use hibernate in conjunction with a database Iit caching will ome into play but will that solve the issue.
    Also colums are sortable, so if a user clicked on a column it would somehow need access to every row in order to sort correctly.
    Although the table column can have seventy columns by default only ten are shown, however the other sixty are still stored in the tables data model using valuable memory so I think I could grab some memory back here, but then if they decide to show the other 60 columns it could blow memory in one go.
    I also considered using some kind of paging mechanism so that even if there were 100,000 rows loaded , only a 1000 were loaded into a table in one go, and you get to the bottom of the table the next 1000 are loaded, is this feasible I cannot work out how to even make a start on this.
    thanks for any advice

    A few things to check:
    1. make sure your AS GroupRoleID class has RemoteClass
    metadata like so:
    [RemoteClass(alias="qa.data.inMemory.PlayerID")]
    public class PlayerID extends Object {
    2. make sure your AS GroupRoleID class is used in your mxml
    file by declaring at least one variable of that type (even if you
    don't instantiate or use it)
    3. make sure your AS GroupRoleID class has a toString()
    method that includes the roleId and groupId values to ensure each
    instance returns a unique value.
    When records appear to have matching identities this can
    happen. Sometimes it can be because of an incorrect identity in
    your destination but also if the object's toString() always returns
    the same value (default being [object Type]).
    I'm writing up a bug to look for a better way of ensuring
    this uniqueness in the future.

  • Exceeding the 40k limit with LocalConnection

    Hi, I want to exceed the 40k limit with LocalConnection, but
    I don't have the slightest idea, how to do this.
    I get a lot of data from a web-connected flex app and want to
    bring it to a second flash movie. But I don't even get out, how big
    this object is, which I get.
    Does anybody has any ideas how to get this working? Is there
    a paging mechanism to provide data step by step? Any oder ideas?
    Thanks for you help!
    Bye,
    Fritz

    Hi,
    I think JavaScript function apex.widget.textareaClob.upload is not documentes.
    Have you seen this my blog post?
    http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:2939900346183772
    You can download sample application and check code.
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

Maybe you are looking for

  • How to use Read_text in Smart Forms for printing Header Texts

    Dear ALL, I want to print Header Texts in SmartForms, For that I am using T/Code VL02N .. and choosed  Header .. got this details...  from Text Header. Text Name       :0080000441 Language         :EN Text ID             :Z002 Text Object       :VBBK

  • Maintenance Cleanup Task

    I am trying to run Maintenance Cleanup task using ssis but when i execute task it give me following error "[Execute SQL Task] Error: Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'\\10.129.12.27\agq-to-fo

  • Missing internet connection icon in taskbar

    Missing internet connection icon in taskbar windows xp 8250

  • Phone won't send texts

    For some reason, my phone will periodically not send text messages, and the problem won't correct itself until I either reboot it, or I turn on airplane mode, then turn it off. I receive a message that the text message won't send, and it gives me an

  • LiveCycle crash when selecting a pdf for importing

    I am trying to create a new form using LiveCycle and when I go though the initial wizard it asks me if I want to use a PDF as the basis for the form - I select it from my hard drive. It is an x1a format created from a layout I did in InDesign (CS4).