6 Replies Latest reply on Feb 7, 2013 2:10 PM by 985680

    delete a row in and ADF table

      Hi all, I am using jdeveloper

      I am trying to delete rows from a table. I am selecting the rows by a check box. the rowselection property is multiple and I created a transient attribute.
      the method that handles the delete is ino the VO java class. My problem is when I select more than 1 row the process does not succeed. But when I select 1 row the process succeed. Also , sometimes I got this error : JBO-27102: Attempt to access dead view row of persistent id 6

      the method is :
          public void deleteSelectedRows(){
              RowSet duplicateRowSet = this.createRowSet("duplicateRowSet");
              Row currentRow = this.getCurrentRow();
              boolean currentRowDeleted = false;
         Row[] rowsToDelete = duplicateRowSet.getFilteredRows("MarkedForDelete", true);
          if (rowsToDelete.length>0) {
                  for (Row rw : rowsToDelete) {
                      if (rw.getKey().equals(currentRow.getKey())) {
                          currentRowDeleted = true;
                  if (!currentRowDeleted) {
        • 1. Re: delete a row in and ADF table
          Frank Nimphius-Oracle

          have you debugged the class to see what the count of "rowsToDelete" is? If the transient information about the rows to delete is lost, you can try and base the transient attribute on a transient attribute in the entity so the changes are persisted in the entity cache (which I can imagine may be the problem)

          The JBO-27102: Attempt to access dead view row is when a deleted entity is attempted to be accessed through a VO. So you need to make sure the web side iterator is refreshed as well

          • 2. Re: delete a row in and ADF table
            Hello Frank , thank you for your reply. I am using now a method suggested by Timo
                public void deleteSelectedRows(){
                        RowSetIterator delRowIter = this.createRowSetIterator("del_me");
                        while (delRowIter.hasNext()) {
                            Row row = delRowIter.next();
                            if (true == row.getAttribute("MarkedForDelete")) {                  
            I am not getting the error and I am able to delete more than 1 row. But the new problem is , If I create a new rows and try to delete them they are deleted from the view but not from the database.
            to delete them from the database , I need to restart the application and delete them.

            any idea?

            thanks in advance

            • 3. Re: delete a row in and ADF table
              Timo Hahn
              Do you commit the remove somehow?

              • 4. Re: delete a row in and ADF table
                yes after the delete I click a button ( commit ) and after the create also.

                • 5. Re: delete a row in and ADF table
                  Timo Hahn
                  Any error messages from the commit? Otherwise hte rows should be delete from the db too.

                  • 6. Re: delete a row in and ADF table
                    No errors from the commit.

                    when I create a new row and commit , the row is displayed and the row is in the DB.
                    If after that , for example , I select all the rows to delete them, all the rows are deleted from the view, but the newly created rows are still in the DB.

                    I even have a search option in my application, If I search for all the rows before I try to delete them and then go and delete, all the rows are deleted even the newly created.


                    Edited by: Faraj on Feb 7, 2013 6:09 AM