JUTableSortModel throws NPE if table has no rows

Hi people,
I place this here in case its not known about ....
Clicking on a column header in an empty table produces this (JDeveloper 9.0.5):
java.lang.NullPointerException
     at oracle.jbo.uicli.jui.JUTableSortModel.sortByColumn(JUTableSortModel.java:246)
     at oracle.jbo.uicli.jui.JUTableSortModel$1.mouseClicked(JUTableSortModel.java:504)
     at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:207)
     at java.awt.Component.processMouseEvent(Component.java:5137)
     at java.awt.Component.processEvent(Component.java:4931)
     at java.awt.Container.processEvent(Container.java:1566)
     at java.awt.Component.dispatchEventImpl(Component.java:3639)
     at java.awt.Container.dispatchEventImpl(Container.java:1623)
     at java.awt.Component.dispatchEvent(Component.java)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3174)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
     at java.awt.Container.dispatchEventImpl(Container.java:1609)
     at java.awt.Window.dispatchEventImpl(Window.java:1590)
     at java.awt.Component.dispatchEvent(Component.java)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:452)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Regards
Andy

Andy,
here is how I tried to reproduce with the "almost" production release
1. set where clause of the VO the table is based on to a value that doesn't return record
2. Run application and clicked on table header
If this is similar to what your scenario is, then the good news is that this problem seems to be fixed.
Frank

Similar Messages

  • Show scrollpane only when table has x rows

    Is there any way to not make use of scrollpane when a table currently has less that 5 rows ?
    I have my table embedded in a JScrollPane, but I want to show the scrollpane only if my table has atleast
    'x' number of rows.
    Thanks,

    Something like...
    DefaultTableModel tm = new DefaultTableModel(data, index);
    int size = tm.getRowCount();
    JTable t = new JTable(tm);
    JPanel p = new JPanel();
    if(size > 5)
      JScrollPane jsp = new JScrollPane(t);
      p.add(jsp);
    else
      p.add(t);
    // add p to JFrame

  • Performance problem on a table with zero rows

    I queried the v$sqlarea table to find which SQL statement was doing the most disk reads and it turned out to be a query that read 278 Gigabytes from a table which usually has zero rows. This query runs every minute and reads any rows that are in the table. It does not do any joins. The process then processes the rows and deletes them from the table. Over the course of a day, a few thousand rows may be processed this way with a row length of about 80 bytes. This amounts to a few kilobytes, not 278 Gig over a couple of days. Buffer gets were even higher at 295 Gig. Note that only the query that reads the table is doing these disk reads, not the rest of the process.
    There are no indexes on the table, so a full table scan is done. The query reads all the rows, but usually there are zero. I checked the size of the table in dba_segments, and it was 80 Meg. At one point months ago, during a load, the table had 80 Meg of data in it, but this was deleted after being processed. The size of the table was never reduced.
    I can only assume that Oracle is doing a full table scan on all 80 Meg of this table every minute. Even when there are zero rows. Dividing the buffer gets in bytes by the number of executions yields 72 Meg which is close to the table size. Oracle is reading the entire table size from disk even when the table has zero rows.
    The solution was to truncate the table. This helped immediately and reduced the disk reads to zero most of the time. The buffer gets were also reduced to 3 per execution when the table was empty. The automatic segment manager reduced the size of the table to 64k overnight.
    Our buffer cache hit ratio was a dismal 72%. It should go up now that this problem has been resolved.
    Table statistics are gathered every week. We are running Oracle 9.2 on Solaris.
    Note that this problem is already resolved. I post it because it is an interesting case.
    Kevin Tyson, OCP
    DaimlerChrysler Tech Center, Auburn Hills, MI

    Kevin,
    The solution was to truncate the tableThis is not a scoop... isn't it ?
    Table statistics are gathered every weekIs there any reason for that ?
    If stats ran when no rows, perf can be very bad after loading data, and if stats ran when thousand rows, perf can be very bad after deleting. Perhaps can you find a more restrictive stat running ?
    Nicolas.
    Message was edited by:
    N. Gasparotto

  • Table has 85 GB data space, zero rows

    This table has only one column. I ran a transaction that inserted more than a billion rows into this table but then rolled it back before completion.
    This table currently has zero rows but a select statement takes about two minutes to complete, and waits on I/O.
    The interesting thing here is that previous explanations to this were ghost records in case of deletes,
    there are none. m_ghostRecCnt is zeroed for all data pages.
    This is obviously not a situation in which the pages were placed in a deferred-drop queue either, or else the page count would be decreasing over time, and it is not.
    This is the output of DBCC PAGE for one of the pages:
    PAGE: (3:88910)
    BUFFER:
    BUF @0x0000000A713AD740
    bpage = 0x0000000601542000          bhash = 0x0000000000000000          bpageno = (3:88910)
    bdbid = 35                          breferences = 0                    
    bcputicks = 0
    bsampleCount = 0                    bUse1 = 61857                      
    bstat = 0x9
    blog = 0x15ab215a                   bnext = 0x0000000000000000          
    PAGE HEADER:
    Page @0x0000000601542000
    m_pageId = (3:88910)                m_headerVersion = 1                 m_type = 1
    m_typeFlagBits = 0x0                m_level = 0                        
    m_flagBits = 0x8208
    m_objId (AllocUnitId.idObj) = 99    m_indexId (AllocUnitId.idInd) = 256
    Metadata: AllocUnitId = 72057594044416000                                
    Metadata: PartitionId = 72057594039697408                                Metadata: IndexId = 0
    Metadata: ObjectId = 645577338      m_prevPage = (0:0)                  m_nextPage = (0:0)
    pminlen = 4                         m_slotCnt = 0                      
    m_freeCnt = 8096
    m_freeData = 7981                   m_reservedCnt = 0                   m_lsn
    = (1010:2418271:29)
    m_xactReserved = 0                  m_xdesId = (0:0)                    m_ghostRecCnt
    = 0
    m_tornBits = -249660773             DB Frag ID = 1                      
    Allocation Status
    GAM (3:2) = ALLOCATED               SGAM (3:3) = NOT ALLOCATED          
    PFS (3:80880) = 0x40 ALLOCATED   0_PCT_FULL                              DIFF (3:6) = CHANGED
    ML (3:7) = NOT MIN_LOGGED           
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    Querying the allocation units system catalog shows that all pages are counted as "used".
    I saw some articles, such as the ones listed bellow, which addresses similar situations where pages arent deleted in a HEAP after a delete operation. It turns out pages are only deleted in a table when a table level lock is issued.
    http://blog.idera.com/sql-server/howbigisanemptytableinsqlserver/
    http://www.sqlservercentral.com/Forums/Topic1182140-392-1.aspx
    https://support.microsoft.com/kb/913399/en-us
    To rule this out, I inserted another 100k rows which caused no change on page counts, and then deleted all entries with a TABLOCK query hint. Only one page was deleted.
    So, it appears we have a problem with pages that were created during a transaction that was rolled back, huh? I guess rolling back a transaction doesn't take certain physical factors into consideration.
    I've looked everywhere but couldn't find a satisfactory answer to this. Does anybody have any ideas?
    Just because there are clouds in the sky it doesn't mean it isn't blue. Some people would disagree.

    And this is the reason why you should have heaps (unless your name is Thomas Kejser :-).
    Try TRUNCATE TABLE. Or ALTER TABLE tbl REBUILD.
    Erland Sommarskog, SQL Server MVP, [email protected]
    I rebuilt the HEAP a while ago, and then all pages were gone. I don't know if TRUNCATE would have the same results, I would have to repeat the test to find that out. There are many ways to fix the problem itself, including creating a clustered index as Satish
    suggested.
    Id like to focus on this interesting fact I wanted to bring to the table for discussion: You open a transaction, insert a huge load of records and then roll back. Why would the engine leave the pages created during the transaction behind? More specifically,
    why would they not be marked as "free pages" if they are all empty? Why are they not marked as free so scans would skip them and not generate a lot of I/O throughput and long response times just to query a zero row table? Isn't this like a design
    flaw or a bug?
    Just because there are clouds in the sky it doesn't mean it isn't blue. But someone will come and argue that in addition to clouds, birds, airplanes, pollution, sunsets, daltonism and nuclear bombs, all adding different colours to the sky, this
    is an undocumented behavior and should not be relied upon.

  • Need to hide row when table has 1 entry in adobe

    Dear Experts,
    I have made select statement in Initialization and in context i have called Table EKPO and under that EKET based on EBELP where clause. Then I have called Sub form for both Tables and made as EKPO(Role Body Row) EKET(Role Table for subform1, Role Body row for subform2)
    Eg: Table EKPO
                  Table EKET
    Need to hide if EKET has one row for that, I want to know number of rows in table, if row 1 then need to hide otherwise need to show in adobe.
    Sharrad Dixit
    dixitasharad at gmail

    Hi A,
    I hope as per your previous post, you might have already set the presentation variable. You can write the column formula now as:
    case when @{variables.country} = 'All Choices' then sum(revenue) by year else <your previous case to hide the USA column} end.
    Hope this helps.
    Thank you,
    Dhar

  • Search cannot be executed because the table has pending changes

    I'm getting the following error ..... The search cannot be executed because the table has pending changes that would be lost .... in the following scenario ....
    My 1st page is a search page with resulting rows from which the user can select specific rows to process ..... next button will populate the VO for the 2nd page by manually looping thru the selected rows in the VO of the 1st page. Loop logic is in the AM and it calls a method in the VORowImpl that uses setAttributeInternal .... the 2nd page displays the selected rows .....
    Pressing the back button of the 2nd page will display the 1st page and if the user tries to do a new search .... the error shows up.
    Any suggestions on how to handle this?
    Thank you.

    It seems to me that you are using the same VO on both the pages. If that is the case try to use separate VO for each page.
    And as suggested by Sumit, Never use/ rely on browser back button. Instead put a Back button on the second page through you can handle the event yourself rather than leaving on the mercy of browser.
    --Saroj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error: "The search cannot be executed because the table has pending changes that would be lost."

    Hello,
    I'm working a developing an OA page that will displays the contents of an Oracle table and allows the user to update records in a table as needed.
    When I hit submit button to save the changes in the update page, the control goes back to main page (where all the table records are displayed). It displays the updated record with the new information.However when I hit "Go" button on the mainPG, I get the error "The search cannot be executed because the table has pending changes that would be lost. and the changes are not committed.
    ANy suggestions on where I should look will be greatly appreciated.
    Posting code for my controller
    =======================
              if ( pageContext.getParameter("saveRate") != null )
              personam.invokeMethod("saveRateToDatabase");
    Code from my AM
    =============
        public void saveRateToDatabase()
          getOADBTransaction().commit();
          System.out.println("40--After commit has been executed");
    Code from my VORowImpl
    ===================
    package cggv.oracle.apps.gl.server;
    import oracle.apps.fnd.framework.server.OAViewRowImpl;
    import oracle.jbo.domain.Date;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.AttributeDefImpl;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class xxCggGlRatesVORowImpl extends OAViewRowImpl {
        public static final int RATEID = 0;
        public static final int FROMCURRENCY = 1;
        public static final int TOCURRENCY = 2;
        public static final int FROMCONVERSIONDATE = 3;
        public static final int TOCONVERSIONDATE = 4;
        public static final int USERCONVERSIONTYPE = 5;
        public static final int CONVERSIONRATE = 6;
        public static final int MODEFLAG = 7;
        /**This is the default constructor (do not remove)
        public xxCggGlRatesVORowImpl() {
        /**Gets the attribute value for the calculated attribute RateId
        public Number getRateId() {
            return (Number) getAttributeInternal(RATEID);
        /**Sets <code>value</code> as the attribute value for the calculated attribute RateId
        public void setRateId(Number value) {
            setAttributeInternal(RATEID, value);
            //populateAttribute(RATEID, value);
        /**Gets the attribute value for the calculated attribute FromCurrency
        public String getFromCurrency() {
            return (String) getAttributeInternal(FROMCURRENCY);
        /**Sets <code>value</code> as the attribute value for the calculated attribute FromCurrency
        public void setFromCurrency(String value) {
            setAttributeInternal(FROMCURRENCY, value);      
        /**Gets the attribute value for the calculated attribute ToCurrency
        public String getToCurrency() {
            return (String) getAttributeInternal(TOCURRENCY);
        /**Sets <code>value</code> as the attribute value for the calculated attribute ToCurrency
        public void setToCurrency(String value) {
            setAttributeInternal(TOCURRENCY, value);
        /**Gets the attribute value for the calculated attribute FromConversionDate
        public Date getFromConversionDate() {
            return (Date) getAttributeInternal(FROMCONVERSIONDATE);
        /**Sets <code>value</code> as the attribute value for the calculated attribute FromConversionDate
        public void setFromConversionDate(Date value) {
            setAttributeInternal(FROMCONVERSIONDATE, value);      
        /**Gets the attribute value for the calculated attribute ToConversionDate
        public Date getToConversionDate() {
            return (Date) getAttributeInternal(TOCONVERSIONDATE);
        /**Sets <code>value</code> as the attribute value for the calculated attribute ToConversionDate
        public void setToConversionDate(Date value) {
            setAttributeInternal(TOCONVERSIONDATE, value);       
        /**Gets the attribute value for the calculated attribute UserConversionType
        public String getUserConversionType() {
            return (String) getAttributeInternal(USERCONVERSIONTYPE);
        /**Sets <code>value</code> as the attribute value for the calculated attribute UserConversionType
        public void setUserConversionType(String value) {
            setAttributeInternal(USERCONVERSIONTYPE, value);
        /**Gets the attribute value for the calculated attribute ConversionRate
        public Number getConversionRate() {
            return (Number) getAttributeInternal(CONVERSIONRATE);
        /**Sets <code>value</code> as the attribute value for the calculated attribute ConversionRate
        public void setConversionRate(Number value) {
            setAttributeInternal(CONVERSIONRATE, value);
        /**Gets the attribute value for the calculated attribute ModeFlag
        public String getModeFlag() {
            return (String) getAttributeInternal(MODEFLAG);
        /**Sets <code>value</code> as the attribute value for the calculated attribute ModeFlag
        public void setModeFlag(String value) {
            setAttributeInternal(MODEFLAG, value);      
        /**getAttrInvokeAccessor: generated method. Do not modify.
        protected Object getAttrInvokeAccessor(int index,
                                               AttributeDefImpl attrDef) throws Exception {
            switch (index) {
            case RATEID:
                return getRateId();
            case FROMCURRENCY:
                return getFromCurrency();
            case TOCURRENCY:
                return getToCurrency();
            case FROMCONVERSIONDATE:
                return getFromConversionDate();
            case TOCONVERSIONDATE:
                return getToConversionDate();
            case USERCONVERSIONTYPE:
                return getUserConversionType();
            case CONVERSIONRATE:
                return getConversionRate();
            case MODEFLAG:
                return getModeFlag();
            default:
                return super.getAttrInvokeAccessor(index, attrDef);
        /**setAttrInvokeAccessor: generated method. Do not modify.
        protected void setAttrInvokeAccessor(int index, Object value,
                                             AttributeDefImpl attrDef) throws Exception {
            switch (index) {
            case RATEID:
                setRateId((Number)value);
                return;
            case FROMCURRENCY:
                setFromCurrency((String)value);
                return;
            case TOCURRENCY:
                setToCurrency((String)value);
                return;
            case FROMCONVERSIONDATE:
                setFromConversionDate((Date)value);
                return;
            case TOCONVERSIONDATE:
                setToConversionDate((Date)value);
                return;
            case USERCONVERSIONTYPE:
                setUserConversionType((String)value);
                return;
            case CONVERSIONRATE:
                setConversionRate((Number)value);
                return;
            case MODEFLAG:
                setModeFlag((String)value);
                return;
            default:
                super.setAttrInvokeAccessor(index, value, attrDef);
                return;
        /**Gets xxCggGlRatesEO entity object.
        public xxCggGlRatesEOImpl getxxCggGlRatesEO() {
            return (xxCggGlRatesEOImpl)getEntity(0);

    Hi,
    Check these links:
    Oracle Apps: Search cannot be executed because the table has pending changes that would be lost
    Re: Getting error in search page search cannot be executed
    http://jneelmani.blogspot.in/2009/11/oaf-search-cannot-be-executed-because.html
    --Sushant

  • "Error:The search cannot be executed because the table has pending changes that would be lost", after DELETE

    Good day,
    On Search Page, I have searched for the record(s) then deleted a record and got confirmation message i.e. Record has deleted. Next when I search for any record I'm getting below error.
    Error
    The search cannot be executed because the table has pending changes that would be lost.
    Could you please help me to fix this issue. Your response is highly appreciated.
    Item properties:
    Item Style : Image
    Action Type: Fire Action
    Event : delete
    Below is the code using in CO and AM
    Controller (processFormRequest):
    if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
              // The user has clicked a "Delete" icon so we want to display a "Warning"
              // dialog asking if she really wants to delete the employee. Note that we
              // configure the dialog so that pressing the "Yes" button submits to
              // this page so we can handle the action in this processFormRequest( ) method.
              String visit_id = pageContext.getParameter("visit_id");
              String employeeName = pageContext.getParameter("last_name") + ", " + pageContext.getParameter("first_name");
              MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName)};
              OAException mainMessage = new OAException("FND", "XXXX_EMP_DELETE_WARN", tokens);
              // Note that even though we're going to make our Yes/No buttons submit a
              // form, we still need some non-null value in the constructor's Yes/No
              // URL parameters for the buttons to render, so we just pass empty
              // Strings for this.
              OADialogPage dialogPage = new OADialogPage(OAException.WARNING,
                mainMessage, null, "", "");
              // Always use Message Dictionary for any Strings you want to display.
              String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
              String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
              // We set this value so the code that handles this button press is
              // descriptive.
    dialogPage.setOkButtonItemName("DeleteYesButton");
              // The following configures the Yes/No buttons to be submit buttons,
              // and makes sure that we handle the form submit in the originating
              // page (the "Employee" summary) so we can handle the "Yes"
              // button selection in this controller.
    dialogPage.setOkButtonToPost(true);
    dialogPage.setNoButtonToPost(true);
    dialogPage.setPostToCallingPage(true);
              // Now set our Yes/No labels instead of the default OK/Cancel.
    dialogPage.setOkButtonLabel(yes);
    dialogPage.setNoButtonLabel(no);
              // We need to keep hold of the employeeNumber and employeeName.
              // The OADialogPage gives us a convenient means
              // of doing this. Note that the use of the Hashtable is 
              // most appropriate for passing multiple parameters. See the OADialogPage
              // javadoc for an alternative when dealing with a single parameter.
              java.util.Hashtable formParams = new java.util.Hashtable(1);
    formParams.put("visit_id", visit_id);
    formParams.put("empName", employeeName);
    dialogPage.setFormParameters(formParams);
              pageContext.redirectToDialogPage(dialogPage);
        else if (pageContext.getParameter("DeleteYesButton") != null)
              // User has confirmed that she wants to delete this employee.
              // Invoke a method on the AM to set the current row in the VO and
              // call remove() on this row.
              String employeeNumber = pageContext.getParameter("visit_id");
              String employeeName = pageContext.getParameter("empName");
              Serializable[] parameters = { employeeNumber };
             // OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("deleteEmployee", parameters);
              // Now, redisplay the page with a confirmation message at the top. Note
              // that the deleteEmployee() method in the AM commits, and our code
              // won't get this far if any exceptions are thrown.
              MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName) };
              OAException message = new OAException("FND",
                "XXXX_EMP_DELETE_CONFIRM", tokens, OAException.CONFIRMATION, null);
    pageContext.putDialogMessage(message);
    Application Module:
      public void deleteEmployee(String visit_id)
            // First, we need to find the selected employee in our VO.
            // When we find it, we call remove( ) on the row which in turn
            // calls remove on the associated EmployeeEOImpl object.
            int empToDelete = Integer.parseInt(visit_id);
              OAViewObject vo = (OAViewObject)getNonEmployeesSummaryVO1();
        NonEmployeesSummaryVORowImpl row = null;
            // This tells us the number of rows that have been fetched in the
            // row set, and will not pull additional rows in like some of the
            // other "get count" methods.
           int fetchedRowCount = vo.getFetchedRowCount();
            // We use a separate iterator -- even though we could step through the
            // rows without it -- because we don't want to affect row currency.
            RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
              deleteIter.setRangeStart(0);
              deleteIter.setRangeSize(fetchedRowCount);
              for (int i = 0; i < fetchedRowCount; i++)
                row = (NonEmployeesSummaryVORowImpl)deleteIter.getRowAtRangeIndex(i);
                // For performance reasons, we generate ViewRowImpls for all
                // View Objects. When we need to obtain an attribute value,
                // we use the named accessors instead of a generic String lookup.
                // Number primaryKey = (Number)row.getAttribute("EmployeeId");
                Number primaryKey = row.getVisitId();
                if (primaryKey.compareTo(empToDelete) == 0)
                  // This performs the actual delete.
                  row.remove();
                    getTransaction().commit();
                  break; // only one possible selected row in this case
            // Always close the iterator when you're done.
            deleteIter.closeRowSetIterator();
          } // end deleteEmployee
    Thanks,
    Ravi

    Hi
    Check this link Getting error in search page search cannot be executed
    Regards,
    Dilip

  • How to print a graph in which internal table has more than 32 entries?

    hiii experts
    i am trying to make a line graph using 'gfw_pres_show' function module.
    but in report internal table has more than 32 entries
    so how can i print a graph having more than 32 entries?

    Hi ricky_lv,
    According to your description, there is main report and subreport in it, when the subreport spans across multiple pages, you want to show column headers on each page. If that is the case, we can set column headers visible while scrolling in main report.
    For detail information, please refer to the following steps:
    In design mode, click the small drop down arrow next to Column Groups and select Advanced Mode.
    Go to your Row Groups pane, click on the first static member.
    In properties grid, set FixData to True.
    Set RepeatOnNextPage to True.
    Here is a relevant thread you can reference:
    https://social.technet.microsoft.com/Forums/en-US/e1f67cec-8fa3-4c5d-86ba-28b57fc4a211/keep-header-rows-visible-while-scrolling?forum=sqlreportingservi
    The following screenshots are for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

  • How to avoid table refresh on row selection

    Hi,
    I have a table where the row selection happens on selecting the check box in the first column of the row. The check box is bound to the transient Boolean attribute of my VO to support this functionality which is missing in new version of ADF. The selection is working fine, however I am facing the issue with table refresh. Everytime I click checkbox to select or unselect a row my whole table is getting refreshed which is very unusual for user point of view. This is my code for the checkbox column:
    <af:column sortProperty="isSelected" sortable="true"
    headerText="#{bindings.pricingObjects.hints.isSelected.label}"
    id="c4"
    inlineStyle='#{(row.isSelected)?"background-color: #E7E7E7":""};'>
    <af:selectBooleanCheckbox value="#{row.bindings.isSelected.inputValue}"
    required="#{bindings.pricingObjects.hints.isSelected.mandatory}"
    shortDesc="#{bindings.pricingObjects.hints.isSelected.tooltip}"
    id="it4" simple="true"
    autoSubmit="true">
    <f:validator binding="#{row.bindings.isSelected.validator}"/>
    </af:selectBooleanCheckbox>
    I have to keep autoSubmit="true" on selectBooleanCheckbox because the table has to change color of the row everytime the checkbox is selected or deselected. Also, there are multiple commandToolbarButton such as "Delete" which needs to be enabled/disabled depending on the row selection.
    Is there anyway, I can achieve this behaviour with minimal refresh of table?

    Hi Marge,
    Yes I do have Add and Delete toolbar button in the panelCollection and also set partialTrigger="tableId" on them. I need this partialTriggers because Delete button should enable/disable depending on number of rows added in the table. However, I tried removing them but it did not work for me, table is still refreshing. BUT this solution does work in combination of other solution i.e. removing ChangeEventPolicy="ppr" on the iterator. I need ppr because I have a form which is bound to the same iterator and should change on table selection. The design is like this,
    - Read-only Table on top
    - Editable Form below
    - Select the row in table and edit the fields in the form
    If I remove ppr then my form is not updating with the row selection.
    Regards,
    Afroz

  • Issues in Table with Multi-Row Insert

    I have created a master detail screens using jheadstart on 2 separate pages, Master in the Form layout and detail in the Table Layout with multi-row insert, update and delete flags ON. Have set the New Rows count = 2.
    Issue 1
    If I try to delete any existing rows, it gives error for new rows saying value is required for the mandatory fields. It should just ignore the new rows if I have not updated any values for any attributes in the those row(As it does for non Master-Detail Table layout). I guess this might be happening because the jheadstart code is setting the foreign key for new rows the detail, but not resetting the status of the rows back to INITIALIZED.
    I also noticed that the create() of underlying EO is getting called for those blank rows when I click on 'Save' button, even if I have not changed any data in those rows.
    Issue 2
    When I try to select the new rows also for deletion, I am getting a '500 Internal Server Error' with following stack trace... This is also happening for normal (non Master-Detail) Table layout.
    java.lang.IllegalStateException: AdfFacesContext was already released or had never been attached.     at oracle.adf.view.faces.context.AdfFacesContext.release(AdfFacesContext.java:342)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:253)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
    Issue 3
    I have put some validation code in the validate() method in the MyEntityImpl.java class.
    The validate method seems tobe getting called lots of times, in my case 20 times, where the new rows are just 2.
    Environment:
    Jdeveloper 10.1.3, JHeadStart 10.1.3 build 78, Windows XP
    thanks

    Thanks for the reply.
    Issue 1:
    What I have observed that in case of multi-row select enabled tables, the blank rows do not have any data. This is because the EO's create() method is called only when we post the data using 'Save' button. Thus the Foreign Keys are also not setup. This is a correct behavior since create() and FK setups etc should get done only if the user has inputted any value in the new rows and thus intend to insert new data into the table.
    I am able to find the exact cause of this issue. It is happening because in the details table, I have a column which needs tobe shown as checkbox. Since we can only bind checkbox to an Boolean attribute in VO, I have created a transient attribute of type Boolean, which basically calls the getter/setter of actual attribute doing the String "Y"/"N" to true/false conversion. Here is code for the transient attribute getter/setter
    public Boolean getDisplayOnWebBoolean() {
    return "Y".equals(getDisplayOnWeb()) ? Boolean.TRUE : Boolean.FALSE;
    public void setDisplayOnWebBoolean(Boolean value) {
    if(Boolean.TRUE.equals(value))
    setDisplayOnWeb("Y");
    else
    setDisplayOnWeb("N");
    Now when I click on the "Save" button, the setter for the boolean field is getting called with the value = false and this is resulting into the row being maked as dirty and thus the validation for the required attributes is getting executed and failing.
    Issue 2:
    Confirmed that correct filter-mapping entries are present in the web.xml.
    Now when I select the new blank rows for deletion and click save, following exception is thrown:
    java.lang.ClassCastException: oracle.jheadstart.controller.jsf.bean.NewTableRowBean at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.getRowsToRemove(JhsCollectionModel.java:412) at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.doModelUpdate(JhsCollectionModel.java:604) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.processModelUpdaters(JhsPageLifecycle.java:541) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.validateModelUpdates(JhsPageLifecycle.java:571)
    thanks - rutwik

  • Create an internal table with the rows of another internal table.

    Hi I want to know if posible to create an internal table structure with the  rows of another internal table?
    ex.
    If in i_tab column A has this values: row 1 = first, row 2 = second, row 3 = third.
    Now I want that the structure of my internal table be: first, second, third

    Hi,
    If you do this way then what will be the difference between the two table anyway?? First internal table has the same structure irrespective of which row you select. and you are going to store the data from each row to the rows of the second internal table. In that case, the structure of the internal table is the same as first table. and it would have same rows.
    Am I missing something here? or you want to declare the internal table with each field being the structure of the first table? In this case you'd have to do a dynamic declaration of data as the first table can have any no of rows then the second table would have any no of fields in the structure.
    Now if you know that your first internal table is going to have a fixed no of rows eg 3 rows then it becomes simple. Do the following then
    Data: begin of second_table occurs 0,
    first type <first_table type>,
    second type <first_table type>,
    third type <first_table type>,
    end of second_table.
    Regards
    Prasenjit

  • Loading a flat table with duplicate rows in SQL server

    Hi,
    I'm trying to load a flat table with different levels that has duplicate rows. When I'm loading it from my source SQL server enviornment to target SQL server environment.. I can only load 63 rows out of the 1225 rows.. This is happenning because i had to define a primary key on the couple of columns..
    When I just try to load it without a primary key, I get an error that PK needs to be defined for load to happen..
    My table structure looks as follows -
    Lvl1 Lvl2 Lvl3 Lvl4 AccountID AccountDesc
    How do i load all rows of data in my target table using ODI?\
    Please help

    whirlpool wrote:
    Hi,
    I'm trying to load a flat table What is a flat table ? Are you talking about FACT table ?
    When I'm loading it from my source SQL server enviornment to target SQL server environment.. I can only load 63 rows out of the 1225 rows.. This is happenning because i had to define a primary key on the couple of columns..
    When I just try to load it without a primary key, I get an error that PK needs to be defined for load to happen..
    Which IKM is in use ? I can not remember an IKM which needs a PK . Incremental Update IKM needs a Update key which can be a PK or UK at database level or ODI level.
    My table structure looks as follows -
    Lvl1 Lvl2 Lvl3 Lvl4 AccountID AccountDesc
    How do i load all rows of data in my target table using ODI?\
    If you not bother about PK at target then you can go for SQL Control Append to load your target table.
    Thanks,
    Sutirtha

  • Select on table with 1800 rows is slow

    I have a table with 1800 rows. Each entry has a geometry position and a geometry polygon around the position. I am using the polygon to detect which (other) entries are near the current entry.
    In the following testdata and the subsequent query, i am filtering on 625 (of 1865) rows, and then using the .STContains-method to finding other rows (the testdata is fully found by this query, in the live database the values are not so regular as in the testdata.
    The query take 6500 ms. In the live database, only 800 records are (yet) in the table, and it takes 2200 ms. 
    select SlowQueryTable.id
    from SlowQueryTable
    inner join dbo.SlowQueryTable as SlowQueryTableSeen
    on SlowQueryTable.[box].STContains(SlowQueryTableSeen.position) = 1
    where SlowQueryTable.userId = 2
    (The query in the live system is even more complex, but this is main part of it and even simplified as it is just takes too long).
    This script generates test data and runs the query:
    -- The number table is just needed to generate test data
    CREATE TABLE [dbo].[numbers](
    [number] [int] NOT NULL
    go
    declare @t table (number int)
    insert into @t select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9
    insert into numbers
    select * from
    select
    t1.number + t2.number*10 + t3.number*100 + t4.number*1000 as x
    from
    @t as t1,
    @t as t2,
    @t as t3,
    @t as t4
    ) as t1
    order by x
    go
    -- this is the table which has the slow query. The Columns [userId], [position] and [box] are the relevant ones
    CREATE TABLE [dbo].SlowQueryTable(
    [id] [int] IDENTITY(1,1) NOT NULL,
    [userId] [int] NOT NULL,
    [position] [geometry] NOT NULL,
    [box] [geometry] NULL,
    constraint SlowQueryTable_primary primary key clustered (id)
    create nonclustered index SlowQueryTable_UserIdKey on [dbo].SlowQueryTable(userId);
    --insert testdata: three users with each 625 entries. Each entry per user has its unique position, and a rectangle (box) around it.
    -- In the database in question, the positions are a bit more random, often tens of entries have the same position. The slow query is nevertheless visible with these testdata
    declare @range int;
    set @range = 5;
    INSERT INTO [dbo].SlowQueryTable (userId,position,box)
    select
    users.number,
    geometry::STGeomFromText('POINT (' + convert(varchar(15), X) + ' ' + convert(varchar(15), Y) + ')',0),
    geometry::STPolyFromText('POLYGON ((' + convert(varchar(15), X - @range) + ' ' + convert(varchar(15), Y - @range) + ', '
    + convert(varchar(15), X + @range) + ' ' + convert(varchar(15), Y - @range) + ', '
    + convert(varchar(15), X + @range) + ' ' + convert(varchar(15), Y + @range) + ', '
    + convert(varchar(15), X - @range) + ' ' + convert(varchar(15), Y + @range) + ','
    + convert(varchar(15), X - @range) + ' ' + convert(varchar(15), Y - @range) + '))', 0)
    from (
    select
    (numberX.number * 40) + 4520 as X
    ,(numberY.number * 40) + 4520 as Y
    from numbers as numberX
    cross apply numbers as numberY
    where numberX.number < (1000 / 40)
    and numberY.number < (1000 / 40)) as positions
    cross apply numbers as users
    where users.number < 3
    CREATE SPATIAL INDEX [SlowQueryTable_position]
    ON [dbo].SlowQueryTable([position])
    USING GEOMETRY_GRID
    WITH (
    BOUNDING_BOX = ( 4500, 4500, 5500, 5500 ),
    GRIDS =(LEVEL_1 = HIGH,LEVEL_2 = HIGH,LEVEL_3 = HIGH,LEVEL_4 = HIGH),
    CELLS_PER_OBJECT = 64, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    go
    ALTER INDEX [SlowQueryTable_position] ON [dbo].SlowQueryTable
    REBUILD;
    go
    CREATE SPATIAL INDEX [SlowQueryTable_box]
    ON [dbo].SlowQueryTable(box)
    USING GEOMETRY_GRID
    WITH ( BOUNDING_BOX = ( 4500, 4500, 5500, 5500 ) ,
    GRIDS =(LEVEL_1 = HIGH,LEVEL_2 = HIGH,LEVEL_3 = HIGH,LEVEL_4 = HIGH),
    CELLS_PER_OBJECT = 64, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    go
    ALTER INDEX [SlowQueryTable_box] ON [dbo].SlowQueryTable
    REBUILD;
    go
    SET STATISTICS IO ON
    SET STATSTICS TIME ON
    -- this is finally the query. it takes about 6500 ms
    select SlowQueryTable.id
    into #t1
    from SlowQueryTable
    inner join dbo.SlowQueryTable as SlowQueryTableSeen
    on SlowQueryTable.[box].STContains(SlowQueryTableSeen.position) = 1
    --on SlowQueryTable.position.STDistance(SlowQueryTableSeen.position) < 5
    where SlowQueryTable.userId = 2
    drop table #t1
    drop table SlowQueryTable
    drop table numbers
    Using an explicit index hint does do the job, but then the query gets slow if i change the where clause:
    select SlowQueryTable.id
    into #t1
    from SlowQueryTable
    with (index([SlowQueryTable_box]))
    inner join dbo.SlowQueryTable as SlowQueryTableSeen
    on SlowQueryTable.[box].STContains(SlowQueryTableSeen.position) = 1
    where SlowQueryTable.userId = 2
    leads to 600ms, and changing the where clause
    where SlowQueryTable.id = 100
    slows it again down to 1200ms.  Filtering on ID get massively slowed down when using index hint on the spatial index.
    Since the table in the live system will grow to 10000+ rows, and the query is called often by users, I badly need a more efficient query.
    Do I have to create a different queries for each use-case, some with index hints and some without?

    I've run your example and can confirm your results. There's a couple of things that I noticed though.
    After looking at query plans, it's not a matter of "with spatial index" vs. "without spatial index". You have two spatial indexes, one on each column (position and box). When you don't hint the "box" spatial index, the query
    uses the "position" spatial index. Because of what they are indexing (points vs. polygons), the "box" spatial index requires a lot more IO. With some (non-spatial) predicates, the "box" spatial index gives better performance,
    with others the "position" one does. I've yet to figure out exactly why (short on time, I might get back to it in future), but you can examine query plans and use the spatial index diagnostic procs (e.g. sp_help_spatial_geometry_index_xml ) in
    addition to the diagnostics you're running to see why and if you can find a better performing plan/index.
    Bear this in mind. Given a choice of multiple spatial indexes, the SQL Server query optimizer is not able to choose (for the most part, IO etc. aside), which one is best. Also, there is usually only one choice of spatial query plan shape, in general. If
    your query is more complex than the one in your example, you might benefit by breaking it in two: one query to filter out all the rows and predicates that don't use a spatial index and one query that uses the spatial index on the subset. I've had good
    luck with this other situations with complex queries involving spatial predicates. This method may not be applicable to a spatial query as simple as the one in your example, however.
    Hope this helps, Bob 

  • How to find out if a table has logging on?

    I need to temporarily turn off logging, and restore the logging setting afterward.
    How do I find out if a table has logging on or off before my change?

    TUBBY_TUBBZ?alter table tablea nologging;
    Table altered.
    Elapsed: 00:00:00.28
    TUBBY_TUBBZ?select logging from dba_tables where table_name = 'TABLEA';
    LOGGING
    NO
    1 row selected.
    Elapsed: 00:00:00.00

Maybe you are looking for

  • RTF inccorect text when I export my Crystal Report to PDF

    Hello, I'm facing a quite unusual problem. I've developped a VB.NET 2008 application for my customer that creates Crystal Reports from manually-entered text. There's a part where the user can enter RTF text in a RichTextBox control, or import from a

  • How to remove/uninstall custom installed perl modules?

    Hello all. Yesterday I upgraded from 10.3.7 to 10.4.5, then started to reinstall a bundle of perl modules (via the Terminal and 'perl Makefile.PL -- make -- make test -- [sudo] make install'). As I saw too late, some of those modules I installed are

  • Firewire device not showing up in finder, even though connected

    I have a device (Tascam hd-p2) connected to my firewire 800 port on my macbook pro.  It has information on a cf card that I would like to access.   The device shows up in the bus on system profiler, but it doesn't show up in my sidebar in finder, on

  • Migrate os/accounts/apps/setting to an external sad?

    Hi I have a 2011 iMac 27 running Maveicks. My iMac has an internal 1TB HDD Recently I found that the computer is too slow to meet my needs and I plan to buy an external thunderbolt 256GB SSD as an external startup drive. I know how to install Maveric

  • Cann't access oracle 9i with thin jdbc and applet

    Hi.. I write thin jdbc applet and application programs.. application programs works well.. but applet cann't connect... error messages below.. access denied (java.util.PropertyPermission oracle.jserver.version read) web server and dbms server are on