Updating the current row in vo which is bind to af:table.

Dear all.
I have created af table by dragging datacontrol on page.. i also have a form and onclick of button i want to update the current selected row in table..
I am getting the current row properly but when i am trying to update the row.. it gives me following exception.
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Failed to lock the record, another user holds the lock.
oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.
Following is my update code.
public void update(){
//BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Create").execute();
BindingContext bc = BindingContext.getCurrent();
JUApplication japp =
(JUApplication)bc.getCurrentBindingsEntry().get("Entries_AMDataControl");
Entries_AMImpl ampl = (Entries_AMImpl)japp.getApplicationModule();
ViewObjectImpl vo=ampl.getEntries_VO1();
Entries_VORowImpl row=(Entries_VORowImpl)vo.getCurrentRow();
row.setSubject(subject);
ClobDomain c=new ClobDomain(toXML().toString());
row.setXmlcontent(c);
row.setDescription("");
//vo.setCurrentRow(row);
//vo.executeQuery();
//BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Execute").execute();
BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit").execute();
So please can anyone there tell me how can solve this problem.
Thanks,
Regards
jdev version 11.1.1.4.0

Hi Frank
in your AM configuration, set the locking behavior to optimisticIts already optimistic.
is bad coding practice. You should perform updates through teh ADF binding layer and not directlxy against the Application Module Impl class. You can get the >current row from the iterator the table is bound to and set the attributes on itI changed my code to following
RowKeySet rs = getCalcTable().getSelectedRowKeys();
Iterator it = rs.iterator();
DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding empIter =
bindings.findIteratorBinding("Entries_VO1Iterator");
StringBuilder sb = new StringBuilder();
RowSetIterator empRSIter = empIter.getRowSetIterator();
Row currentRow = null;
while (it.hasNext()) {
Key key = (Key)((List)it.next()).get(0);
currentRow = empRSIter.getRow(key);
break;
Entries_VORowImpl row=(Entries_VORowImpl)currentRow;
row.setSubject(subject);
ClobDomain c=new ClobDomain(toXML().toString());
row.setXmlcontent(c);
row.setDescription("");
BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit").execute();
But it still gives me same error.
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Failed to lock the record, another user holds the lock.
oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.
Any suggestion appreciated..
Thanks
Regards.

Similar Messages

  • Is there a way to make the current row not editable

    Hi, I'm using JDev 11.1.1.2
    In my usecase I have a Form , navigateable with next/previous , and for every row a I have a calculation which makes the row editable or not.
    For now I made it with disabled property on every input component set to some bean property which is calculated every time.
    My question is if there is some general way to make an Entity not updateable ?
    I tried with doDML() ... but the problem there is that this method is not called when switching the current row but rather when commiting. So the user can modified several rows and when pressing commit it will prevent some of the to be committed which would be confusing.
    Is there a method in the ViewObject that i can overwrite which is called every time the current row is changed? So I can see if the row was modified or not.
    Thanks, agruev

    Yes, there is always isAttributeUpdateable() in the ViewRowImpl, which you can override and enable/disable your attributes based on an enabling/disabling condition.
    Here is an example:
    public boolean isAttributeUpdateable(int i) {
    boolean updateable = false; /disable by default all arguments
    // enable, if your condition is met
    if ( meets_your_condition )
    updateable = super.isAttributeUpdateable(i); // let the framework decide based on your declarative settings
    return updateable; // return true/false indicator
    Nick

  • Issue in finding the current row

    I am rendering rows of a VO using an iterator component. One of the component I am rendering is a declarative component created by me.
    In this component there is a clickable link on which i can write any method to achieve desired functionality.
    Since, iterator is used so the current row is set to the last row. Now on clicking the link in the declarative component i need to do some operation based on the current row (pk of that row). So, how to find the current row id?
    Note: If it would be a simple adf component like a commandLink i could have inserted a setServerListener inside it and could have put the id in to requestScope to access it. But as this is the declarative component in which i cannot create a serverListener so I am looking for some other solution.

    Hi john,
    My table have the selection listener.
    Thanks in advance

  • Change the current row in an iterator and reflect the change on page

    Hi there,
    I have a jspx with a creation form created as usual draging and droping the data control. In same page, I inserted a commandButton which ActionListener executes a method in a managed bean called validate(). Through such a method what Im trying to do is to fill the form with data from specified entry of the database if certain condition is true. I know it is kinda twisted but unfortunately is the requirement for the page.
    So basically in "validate" method, if the condition I mentioned is reached, I do the following:
    // execute a Rollback (included in Page Definition) in order to cancel the previous auto-invoked "Create".
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    BindingContainer bindings =(BindingContainer)app.getVariableResolver().resolveVariable(context,"bindings");
    OperationBinding opBinding = bindings.getOperationBinding("Rollback");
    opBinding .execute();
    //get the iterator and asociated VO from the binding container
    ValueBinding vb = app.createValueBinding("#{bindings.AccountsVOIterator}");
    DCIteratorBinding dciter = (DCIteratorBinding) vb.getValue(FacesContext.getCurrentInstance());
    ViewObject view = dciter.getViewObject();
    //and set the current row with the specified entry I have mentioned above.
    Object keyValues[] = new Object[2];
    keyValues[0] = "1"; keyValues[1] = "98543";
    Row[] row = view.findByKey(new Key(keyValues),1);
    AccountsVpnVORowImpl client = (AccountsVpnVORowImpl)row[0];
    view.setCurrentRow(client);
    view.executeQuery();
    dciter.setCurrentRowWithKey(client.getKey().toStringFormat(true));
    dciter.executeQuery();
    opBinding = bindings.getOperationBinding("Execute");
    opBinding.execute();
    All this works perfectly when I debbug it but I cannot see the changes in the page(even refreshing browser). I need that when such a condition is met, the creation form turns into a modify-specific entry form, filling all fields with the specific data in order user can modify it, and all in the same page.
    Any clue?
    Thanks so much in advance for your time.

    Hi,
    I could see the problem with call to executeQuery and execute methods at the end of your method which re-sets the current row.
    Once you set the current row you should not call execute or executequery methods. Try removing those calls and also make sure that you have added partialTriggers property on the table is set to commandbutton id and partialSubmit property is set to true on commandButton to refresh the table partially on click of a button
    Sireesha

  • Select the current row in read only querry VO

    Hi.,
    I am using jdev 11.1.1.5
    I had created a Finyear EO with corresponding VO
    I had also created a read only querry VO [PostdGLhdlnVO]
    I had created a viewlink between FinyearVO and PostdGlhdlnVO with following conditions
    FinyearVO.bu = PostdGLhdlnVO.bu
    FinyearVO.year = PostdGLhdlnVO.year
    I need to select the current row and print that row using println statement. as i am using readonly querry while i drag and drop the PostdGLhdlnVO i cant able to select the current line (i.e., when user clicks the current row)
    My scenario:
    I need to create a non database checkbox for every row in that table [PostdGLhdlnVO] which will get the current row
    can anyone help me to create a nondatabase checkbox for that table

    Try,
    This may help:
    Re: ADF Table Multiple row selection by Managed Bean-Prasad

  • Losing the current row without doing anything

    I using 10g and my page have a VOR (viewobject readonly) to control form data but...
    I'm losing several times the current row ... for example I put this code in a button:
    public String clickAction() {
    AdminUCAtoCartorarioAMImpl am = null;
    try {
    am = ( AdminUCAtoCartorarioAMImpl )super.getApplicationModule( "AdminUCAtoCartorarioAMDataControl" );
    am.getAmbienteEscaninhoVOR().getCurrentRow(); //Here, sometimes brings me null.
    } catch (Exception e) {
    e.printStackTrace();
    return null;
    }

    User,
    You give us the symptom of the problem, but
    I'm losing several times the current rowdoesn't help anyone to help you pinpoint what might be the cause. Under what circumstances does the current row come across as null? Are you manually iterating through the VO's row set somewhere? What happens before the current row is "lost?" What specific version (your tag indicates 10g, but specifically which version) of JDeveloper/ADF are you using? Does this occur only when deployed, or does it occur when running in the embedded OC4J.
    One thing for you to try... if it occurs "sometimes," seemingly randomly under load, try turning off Application Module Pooling and re-test. If it occurs every time with pooling turned off, you are likely seeing some issue related to passivation/activation - which is why it would be critical to mention the exact version; there are known issues with specific versions, and there are patches available.
    John

  • Select the current row

    hi.,
    I am using jdev 11.1.5
    can any would please tell me how to select the current row in a table and perform operations in it.,
    My Scenario:
    I had created a table.,
    If the user clicks the button named post it must check the attribute [
    Year] and the Status must be updated to all the year
    For eg;
    St Year
    N 201011
    N 201112
    if the user clicks the button The st attribute should be updated with corresponding Year
    so that the N must be updated to P with the year 201011 now my output should be
    st Year
    P 201011
    N 201112
    any one can pls help me

    Hi..
    You can try this using In built Bindings.For that Table need row selection single and need form using same VO.for update drag Commit operation as a button to form.
    http://www.mandsconsulting.com/adf-table-row-selection-event-update-form

  • Can any one tell me how to change the current row header in FB1LN tcode

    Hi,
    can any one tell me how to change the current row header in FB1LN tcode.
    I want to show input date also in the layout.
    Regards
    Mave

    Hi
    I know two ways:
    - transaction obvu: here you can insert new fields, but only if these fields are included in certain table (like BKPF, BSEG, BSIS.....
    - if your field isn't included in those table, you have to modify the structure RFPOS and manage it in the BTE 1650. After updating RFPOS you have to run the program RFPOSXEXTEND to update the structure RFPOSXEXT.
    Max

  • How to update  the restricted rows that were selcted using fetch

    Hi
    I have to fetch  one row at a time from my staging table using JDBC Sender Adapter,  which is configured against AS400 DB2 and push it to R/3.
    The select  SQL looks like this in JDBC Sender Adapter
         <b>select  jedata, oxruns from fxjrnep2 where oxsts=' '   fetch first 1 rows only</b>
                                       and
    update sql is
         <b>update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS=' ' </b>
    The problem here is my select gets one row, which is what i want, but my update actually updates all the rows that satisfied the where condition oxsts=' ' instead of one.
      I couldn't  use <b>fetch first 1 rows only</b> at the end of the update sql to update the selected row. DB2 does not allow  fetch in update sql.
    Can anyone suggest solution here or recommend alternative?
    Best Regards
    Venkat

    check for update query where u can club the select stmt u had used with udpate like:
    update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS = (select jedata, oxruns from fxjrnep2 where oxsts=' ' fetch first 1 rows only
    just need to try combinations of this type.
    if still this is not working use a bpm and get all the records where OXSTS is null and process record one by one within a block

  • ORA-20001: The current row is locked

    Hi Team
    I find below mentioned error message in my log table .Please can you suggest why we are getting this error .
    Some time back we had our OS migration from one server to another ,can it be related to that as we have noticed this error message after such migration.
    Please suggest what can be done in order to avoid such error.
    ERROR IN hr_person_api.update_person api failed -step4 -ORA-20001: The current row is locked
    Cause:        You are trying to lock a row in the per_people_f table which is currently being locked by another user. 
    Action:        Re-query and attempt to lock the row again
    ERROR IN hr_assignment_api.update_emp_asg API - STEP8.2 - ORA-20001: The current row is locked
    Cause:        You are trying to lock a row in the per_all_assignments_f table which is currently being locked by another user. 
    Action:        Re-query and attempt to lock the row again.
    Regards
    Anima

    Hi Everyone
    Can anyone help me with this .Why we are getting this error and how can it be handled.
    Please suggest what can be done in order to avoid such error.
    ERROR IN hr_person_api.update_person api failed -step4 -ORA-20001: The current row is locked
    Cause:        You are trying to lock a row in the per_people_f table which is currently being locked by another user. 
    Action:        Re-query and attempt to lock the row again
    ERROR IN hr_assignment_api.update_emp_asg API - STEP8.2 - ORA-20001: The current row is locked
    Cause:        You are trying to lock a row in the per_all_assignments_f table which is currently being locked by another user. 
    Action:        Re-query and attempt to lock the row again.

  • Get the icon for the current row selected

    Hi !!
    I am using jdeveloper 11.1.1.5
    I had dragged and dropped my ApplBusFunVO as a af:tree
    My Output will look like this
    Supplier Balance
    Supplier Document Details
    Purchase order
    Purchase ReceiptsMy af:tree doesnt contains the Parent
    My Scenario:
    When my user clicks the current node of the tree!! an icon should appear before the current node is selected
    For Eg: If my user clicks the Purchase Order then my output should like this
    Supplier Balance
    Supplier Document Details
    ==>Purchase order
    Purchase ReceiptsThe Symbol ==> Represent the icon! that appears before the purchase order!!

    Hi
    <af:tree value="#{bindings.SalesPeople.treeModel}" var="node"
              selectionListener="#{bindings.SalesPeople.treeModel.makeCurrent}"
              rowSelection="single" id="t4" fetchSize="35">
              <f:facet name="nodeStamp">
                 <af:group>
                      <af:image id="cl3" source="#{reference_to_image_url}"
                      rendered="#{check_if_current_row}"/>
                      <af:outputText id="ot2" value="#{node}"/>
                 </af:group>
       </f:facet>http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12419/tagdoc/af_image.html
    As mentioned in a previous answer to this very same question, the tree is a stamped component which means that you need to partially refresh the tree component to show the icon. You can us the selectionListener (override the current setting to use a managed bean setting the current row - calling the same EL) to determine the new selected row key and then use the rendered option to determine (using a managed bean reference) if the current rendered node (#{node} is accessible from a managed bean at render time) is the selected node.
    The side effect is that upon tree node selection the tree will "flicker"
    Frank

  • Updating the same row in different sessions

    Hi,
    I've one table application(appl_no varchar2(10), locked_user varchar2(8)) which is used to track which user is logged in at present.
    As soon as any user is logged in to the system via front end, the user ID is populated to locked_user column so that no other user cannot access the same appl_no. As soon as the user exits from the front end, the locked_user is updated to null.
    We've experiencing a strange behaviour in our system where one user exits from front end and at the same time(previous transaction is not committed) the same user ID opens the same application in another session, but the session session doesn't gets hanged(waiting for the lock to be released) and tries to update the same row which was locked by first user's session. We come to know this thing when the trigger on the table gets fired in both sessoins.
    Now I want to know if there is any locking machanism in Oracle where the same row can be updated in 2 different sessons one after another when the first session has not committed its changes?
    Thanks
    Deepak

    And obviously no two sessions can update the same record at the same time
    Yes I know that and I tried the same thing by myself on 2 different sql sessions which is not happening, but this is happening when the same is being done from front end(Power Builder based application).
    Just wanted to check is there any possibility where this can be possible?
    Thanks
    Deepak

  • How to Select the Current Row When Using af:iterator?

    Hello all,
    I encounter the following problem when using af:iterator to display data from
    a View Object:
    When trying to display the content of a row via a popup, only the first row is
    returned no matter which row is selected. So a selection of the current row
    should exist or some other method which should allow the access to the
    current row.
    The af:table has a selectionListener attribute which permit to achieve this.
    Does anyone know about some similar attribute or some method for
    selecting the current row when the af:iterator is used?
    Thank you,
    Mirela

    I would be interested in the answer to this basic question as well. I cannot get the selected row value of an attribute in an iterator for a view if I simply set-up a attribute binding to the iterator. It seems that this should be possible. I've had no other option but to obtain the current row and the related attributes programmatically. This works fine, but if there is a more elegant option, then I'd certainly like to use it.
              <af:table value="#{bindings.CompaniesView1.collectionModel}"
                            var="row"
                            rows="#{bindings.CompaniesView1.rangeSize}"
                            emptyText="#{bindings.CompaniesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                            fetchSize="#{bindings.CompaniesView1.rangeSize}"
                            selectedRowKeys="#{bindings.CompaniesView1.collectionModel.selectedRow}"
                            rowBandingInterval="0" id="tCompanies"
                            summary="Companies"
                            width="100%"
                            rowSelection="single"
                            binding="#{CompanyBackingBean.companiesTable}">Page Def:
        <attributeValues IterBinding="CompaniesView1Iterator" id="Id">
          <AttrNames>
            <Item Value="Id"/>
          </AttrNames>
        </attributeValues>I should be able to get the Id attribute value of the current selected row using "#{bindings.Id}", right? Well, it doesn't work for me. Any ideas?
    Thanks

  • Maintain the current row position of a table after refresh.

    Hi,
    I use a poll to refresh tables continuously. when a table is refreshed, the current referring row is reset.
    To maintain the current row position after a refresh I use the following poll method.
    public void refreshTableT1(PollEvent pollEvent) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding dcb = fctx.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bindings1 = (DCBindingContainer) dcb.getValue(fctx);
    DCIteratorBinding dciter = bindings1.findIteratorBinding("<VOIterator>");
    if(dciter!=null){
    if(dciter.getCurrentRow()!=null){   
    Key current_row_key = dciter.getCurrentRow().getKey();
    dciter.executeQuery();
    if(current_row_key!=null){
    try{
    dciter.setCurrentRowWithKey(current_row_key.toStringFormat(true));
    }catch(Exception ex) {
    System.out.println("Exception in current_row_key");
    }This works for normal tables well. But when I use it to master-detail tables (pair of tables) it does not.
    At the master-detail tables, before the first data fetch, it works well. if we go below the first data fetch, it sets the current row into another position.
    how can I overcome this...??
    Thanks,
    Dinuka.

    Hi Mr.Frank,
    I have an association in two VOs.
    for example: There are 2 tables called Emp and Dept. Every Department has Employees. so there is an association (both tables have a common column). Master table is the Dept table. when you click on one record of the Dept table Detail table will show the details of the employees belongs to that selected department. That's what I referred as master-detail tables. first one is master table; second one is detail table.
    When the web page loads all the table data is not fetched from the db (it will depend on the fetch size). when we scroll down the table data fetch happens again and again.
    think my data fetch size is 25 rows per time.
    Suppose we use mine poll method and think I have clicked on the 20 ^th^ row of table1(master table). then the table2 will display details belongs to selected department. that is OK even after refresh. that works well.
    when I go to 30 ^th^ row data fetch will happen (my fetch size = 25)
    when I click on the 30 ^th^ row of the table1(master table), table2 will display details belongs to selected department. but after the poll method is called the selected row at the table1 disappears and is set to another position. now the 30 ^th^ row is not in the 30 ^th^ position. but it is the selected row and table2 displays correct details.
    I think you have got the problem now. :D
    Thanks a lot.
    Dinuka.

  • Fetch the current row in executeQueryForCollection

    Here is what I have:
    Master-detail-detail
    VO1
    --VO2 via VO1VO2Link
    -----VO3 via VO2VO3Link
    I am editing or creating new record in VO3 (Say UIX input form) but want to implement 'rollback' button and go back to the CURRENT row in VO2 (WITHOUT RESETING ITERATORS!!!!!!!). For the sake of this thread let's just say that the process of doing this is extremely frustrating and that I have to debug certain things so my idea was to take a look into the WHATEVER is the CURRENT row in executeQueryForCollection of VO2:
    //in VO2ViewImpl.java
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
        // TODO:  Override this oracle.jbo.server.ViewObjectImpl method
        Row currentRow = this.getCurrentRow();
        if (currentRow != null)
           Object[] o = currentRow.getAttributeValues();
      //    if (o!=null)
            //System.out.println("val[0]= " + o[0]);
            //System.out.println("val[0]= " + o[1]);
            //System.out.println("val[0]= " + o[6]);
            //System.out.println("val[0]= " + o[8]);
    }My application breaks at Object[] o = currentRow.getAttributeValues();
    for some reason? Why???
    The error displayed is:
    JBO-26100: An error occurred after commit was performed.
    The bottom line question is what is the current query in executeQueryForCollection?

    Here is what I have:
    Master-detail-detail
    VO1
    --VO2 via VO1VO2Link
    -----VO3 via VO2VO3Link
    I am editing or creating new record in VO3 (Say UIX input form) but want to implement 'rollback' button and go back to the CURRENT row in VO2 (WITHOUT RESETING ITERATORS!!!!!!!). For the sake of this thread let's just say that the process of doing this is extremely frustrating and that I have to debug certain things so my idea was to take a look into the WHATEVER is the CURRENT row in executeQueryForCollection of VO2:
    //in VO2ViewImpl.java
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
        // TODO:  Override this oracle.jbo.server.ViewObjectImpl method
        Row currentRow = this.getCurrentRow();
        if (currentRow != null)
           Object[] o = currentRow.getAttributeValues();
      //    if (o!=null)
            //System.out.println("val[0]= " + o[0]);
            //System.out.println("val[0]= " + o[1]);
            //System.out.println("val[0]= " + o[6]);
            //System.out.println("val[0]= " + o[8]);
    }My application breaks at Object[] o = currentRow.getAttributeValues();
    for some reason? Why???
    The error displayed is:
    JBO-26100: An error occurred after commit was performed.
    The bottom line question is what is the current query in executeQueryForCollection?

Maybe you are looking for

  • How to install Serial # on replacement hard drive in orig. computer?

    Hard drive failed, replaced and program installed on new drive. It is stating that the program is already installed on two computers. The program is only installed on my laptop and the original failed hard drive of my home computer. How do I correct

  • Can't get instant client to work on Win XP

    This is driving me nuts. I'm trying to get instantclient10_1 (10.1.0.4) to work reliably on Win XP so I can use it in deploying a Python app I'm writing. I have one XP system on which I have the instant client installed and working. By this I mean th

  • How To Generate Debug Log Files for ebs jsp?

    hi   How To Generate Debug Log Files for ebs r12 jsp? and where i get the log .please help me thanks!

  • Copy control for copying sales transactions

    Dear all, I want to copy document X (complaint) to document type Y (sales order) in CRM online but the requested delivery date should be cleared and not copied from document X. I am trying this with BADI "CRM_COPY_BADI" but in this BADI I can't find

  • Help with the problem query

    Hi, I have another query running slow when executed from cognos. It is also not returning any output continues to execute, with "Union15" as ( select distinct CASE WHEN(substr(to_char(FLOOR("EES_ENERGY_MASTER"."DISC_MON"/100)), 1, 4) IS NULL) OR (cas