This discussion is archived
12 Replies Latest reply: Mar 28, 2013 10:12 AM by adfLearner RSS

Cannot commit updates

BAO.SZ Newbie
Currently Being Moderated
work in jdev 11.1.2.3
I create a EO/VO and drag and drop the data control to a jspx page with SUBMIT button.
and also I drap and drop COMMIT, ROLLBACK button into the same page from the data contral panel.
(and set the partial submit property to TRUE for these three button).
and it runs:
1.The SUBMIT is enabled, COMMIT, ROLLBACK are disabled when the page show.
2.edit some fields on the page, and press SUBMIT, and the COMMIT, ROLLBACK are enabled.
3.press the COMMIT, and it looks OK-refresh the page, shows the updated data for the fields. but I check the database in ORACLE SQL DEVELOPER. the data has not been changed yet.

Why the COMMIT cannot work?

Thanks.
BAO
  • 1. Re: Cannot commit updates
    sazz619 Newbie
    Currently Being Moderated
    are you sure that you have take the commit and rollback buttons from the Data Control pallete ?
    If so it should work .
    If not can to try deleting the buttons from ur jsfs and readding them ,try again....
    If still doesnt work no idea how to resolve the issue....sry
  • 2. Re: Cannot commit updates
    BAO.SZ Newbie
    Currently Being Moderated
    hi,
    tried it again-delete the COMMIT,button and redrag and drop again. the problem remains:
    1.SUBMIT->COMMIT,-->refresh the page-->show the updated field data. but cannot see this updates in database.
    --if I have enter or update wrong data in the field, will some alert be given?
    2. if DELETE->SUBMIT->COMMIT-> can see the record been deleted in database.

    regard
  • 3. Re: Cannot commit updates
    Timo Hahn Oracle ACE
    Currently Being Moderated
    Do you see any error messages in the log files?

    Timo
  • 4. Re: Cannot commit updates
    BAO.SZ Newbie
    Currently Being Moderated
    Hi, Timo:
    I tried again and let me give more details:
    1.There are three VOes which derived from same EO, and there is a LINK between VO1 and VO2 as a mater-detail relationship by a (*id, parent_id*) attributes pair(1-m relationship). and there is another link between VO1 and VO3 by a (id, id) attributes pair(1-1 relationship).
    The data control pallete looks someting like:
    +VO1
    ---id,
    ---name,
    +VO2,
    +VO3
    2.drop the VO1-VO2 data controls as a TABLE TREE component, and the VO3 data control as a ADF FORM component into the same jspx page with SUBMIT button on. and
    3.drag and drop DELETE, CREATEINSERT(from the VO3 data control pallete), COMMIT, ROLLBACK button after the ADF FORM component.
    when it runs:
    1.Can DELETE the record and COMMIT into the database successfully. BUT,
    2.Cannot update fields for the ADF FORM components(drag from VO3 data control)--can SUBMIT and COMMIT in the page, but no updates in database--and gives no error msg in log file.
    3.When click CREATEINSERT button. get a error msg like this (in Chinese): too many objects matches the primary key oracle.jbo.Key[025013040000000009].

    Is it because I'm trying to update the detail VO3 with more than one records (but it is a 1-1 relationship)?
    How to implement this USE CASE (displaying an entity data which has a self master-detail relationship with a tree structure, and performance CRUD for this entity )?

    Thanks.

    Edited by: user6715237 on 2013-3-23 下午9:51
  • 5. Re: Cannot commit updates
    adfSonal Newbie
    Currently Being Moderated
    Please set the 'disabled' property of the COMMIT and ROLLBACK buttons as default.

    Also please check the ActionListener property of the Commit button. I hope its set to #{bindings.Commit.execute}

    Also check whether the view object is based on Entity Object, and not a read-only one.
  • 6. Re: Cannot commit updates
    adfLearner Explorer
    Currently Being Moderated
    Have a look at the sample created for the same : http://www.datafilehost.com/download-babbe51a.html

    1. Delete working fine as you said.
    2. Update is also working fine... You can have a look at the implementation.
    3. Create Insert : too many objects matches the primary key oracle.jbo.Key[025013040000000009].
    Note : You have defined link between VO1 and VO3 by a (id, id). So when you try to do a createInsert, it will try to create a record in VO3 with id of VO1 which are used for creating the link i.e. you are trying to create two links with same id.
    To understand this - As implemented in my sample, say you have selected a employee Steven ( Id 103 ) in your tree. Same is selected in VO3 as there is 1-1 relationship. Now if you try to create an employee in VO3, will it now create a record with Emp Id as 103 which is primary key in VO3 also. Should it happen - Yes. How about product Supplier scenario where the viewLink is based on Product Id. So when you create a supplier under a master detail relation, product Id is prepopulated in Supplier record created. There is no error because productId is not the primary key for Supplier table.

    I hope this answers your query.

    Thanks,
    Rajdeep
  • 7. Re: Cannot commit updates
    BAO.SZ Newbie
    Currently Being Moderated
    hi,Rajdeep
    Thank you for your good suggestions!
    But after download your sample , a warning was given by the anti-virus software in my computer as:
    The downloaded file ThreadId2516225.exe contains malware,(HEUR/Malware.QVM20.Gen).....
    and was deleted automatically.

    Edited by: user6715237 on 2013-3-25 上午3:04
  • 8. Re: Cannot commit updates
    adfLearner Explorer
    Currently Being Moderated
    I have uploaded it on dropbox now


    http://dl.dropbox.com/u/70986236/Question%20Posted%20on%20OTN/ThreadId2516225.rar

    Thanks,
    Rajdeep

    Edited by: Rajdeep on Mar 25, 2013 6:51 PM
  • 9. Re: Cannot commit updates
    BAO.SZ Newbie
    Currently Being Moderated
    Hi,Rajdeep
    Thank you very much for your kindness and patience to send me the sample you created! I'v download and have a try. Here is the results:

    1.Since there is a 1-1 (id,id) relation between VO1 and VO3, we cannot create new records for VO3 without violating PK constraint for EO.
    so I delete all VO3 page components and re-drag and drop VO1 from data control into the page again.
    --now the TREE display and adf-FORM components are all based on the same VO1, and also add createinsert, delete button for the page.
    and to my suprise, the newly created adf FORM components include all attributes from EO (employeeid,firstname,lastname,departmentid,email,hiredate...)
    --but the VO1 query only include 3 attributes (employeeid,firstname,lastname)
    -- and these three attributes can be seen under the DATA CONTROL structrue tree.
    and I went on..

    2.At the EmployeesEO attributes tab page, set the EmployeeId.type to DBSequence.--to create PK- employeeid automatically.

    3.Run the testView.jspx page.
    all seems ok even now:
    --the TREE at left panel display rightly.
    --the navigate button functions rightly for the right panel's emp form.and the records can be synced between the tree and the form.
    --DELETE->SUBMIT->COMMIT is ok.
    --edit some field ->SUBMIT-COMMIT is ok.

    but when I press CREATINSERT :
    --only three fields(employeeid,firstname,lastname) left on the page, others dispeared, and empoyeeid = -2,
    --press SUBMIT, warnnings to fill required fields showed: email,hiredate,jobid are requiring input.
    --press SUBMIT again, all fields(more than the above three) appeared again now. and filling all fields.
    --press SUBMIT again, no warnings.
    --press COMMIT, an error popup showed: ORA-01400: cannot insert a NULL ("HR"."EMPLOYEES"."EMPLOYEE_ID")
    ORA-06512: 在 line 1.
    --change employeeid = 2,
    --press COMMIT again.
    --data were saved succussfully now.

    BUT there are must have something wrong in the above process.
    and if i :
    At the EmployeesEO attributes tab page, set the EmployeeId.type to integer.
    and run Test.jspx:
    the tree and form cannot display correctly nowand there is an error on the log file:
    java.lang.ClassCastException: java.lang.Integer cannot be cast to oracle.jbo.domain.DBSequence

    Can you help me further to solve these problems?

    Thank you again.
    BAO

    Edited by: user6715237 on 2013-3-26 上午4:35
  • 10. Re: Cannot commit updates
    adfLearner Explorer
    Currently Being Moderated
    Wasn't the reply helpful.. ? Marking posts helpful and answered as per [Please read this before you post |https://forums.oracle.com/forums/ann.jspa?annID=56]

    If you can send me the application ( modified after whatever u tried ) and the required implementation you want to achieve. I can take a look

    Thanks,
    Rajdeep
  • 11. Re: Cannot commit updates
    BAO.SZ Newbie
    Currently Being Moderated
    Hi, Rajdeep
    Your first post to this thread is not only helpful, but almost close to correct! And I'm thinking to mark it as Correct after I have clear out all left doubts--but now I mark it helpful first. And i really thank you very much.

    I am a newbie to Jdev/adf technology, i have 3 years dev experience for Oracle Forms many years ago. And have very few knowledge on java. So the questions I post in this forum maybe pretty simple.

    The required implementation I want to achieve for this thread is: for a self-related entity (such as Employee entity with manager-emp relation), displaying data in a tree for navigation and perform CRUD in a form layout in the same page.-- Just like Your sample's implementation.

    And my last try was on your sample--but I cannot access the dropbox site here(China), so one of my friends in Canada download it and send to me in email. I don't know how to send email to you? Here is my email: jiangjunb@126.com

    The modification to your sample is: delete VO3 components in the page, and drag/drop VO1 from data control and choose adf form components. And the running results is as described in my last posts --there is something wrong yet, and I hope someone like you can give further help.

    Regards.
    Bao
  • 12. Re: Cannot commit updates
    adfLearner Explorer
    Currently Being Moderated
    Here goes the updated sample ...


    https://dl.dropbox.com/u/70986236/Question%20Posted%20on%20OTN/ThreadId2516225.zip


    I have introduced another table from a new VO ... just for your help.. Because when u select a record and try delete ... it will be allowed for records which are not having any dependency. I hope you understand that. SO fo quickly checking independent records that table is there.

    Thanks,
    Rajdeep

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points