Entity with key cannot be owned by another row

Hi All,
I have a master detail relationship between 2 VOs using Entity level association. When I try to create details rows using createAndInitRow(), I am getting below error. The Association has composition association, cascade delete, cascade update key attributes selected
Entity with key:oracle.jbo.Key[ XXXXXXX ] cannot be owned by another row:oracle.jbo.Key[ XXXXXXX ]
Code -
RowSetIterator rsi = (RowSetIterator)((ParentVORowImpl)parentCurrentRow).getChildVO();
NameValuePairs nvp = null;
Row row = null;
for (ExpressionObject obj : objectList) {
nvp = new NameValuePairs();
nvp.setAttribute("AAA", "AAA");
nvp.setAttribute(<Attributes>, <Attribute Values>);
row = rsi.createAndInitRow(nvp);
rsi.insertRow(row);
The moment createAndInitRow is called for first item I get the error and other items does not get associated with parent properly.
Any clue what wrong am I doing??

Copying from [http://www.packtpub.com/oracle-application-development-framework-real-world-developers-guide/book|Oracle ADF Real World Developers Guide]
Creating child rows in composition association
Creating a new child row is a bit tricky when the master-child entity association
type is composition. When you mark an association between master and child entity
objects as composition, the framework takes the necessary steps to ensure that the
child entity object row does not exist without the master entity row. If you try to
create a new child row by calling createRow() on the view object, the framework
will throw the oracle.jbo.InvalidOwnerException: JBO-25030: Failed to
find or invalidate owning entity exception.
There are two possible ways to create child entity rows in this case:
• Find the master row by using findByKey() or calling executeQuery() with
a proper condition and then get the RowIterator for the child collection
by accessing the view link accessor attribute. Now you can use the child
RowIterator to call createRow() for creating the child row. The following
code snippet illustrates the creation of the child entity row for the
Country-Location composition association:
//In application module implementation class
* This custom method defined in application module
* creates child location rows for a master
* country entity through accessor iterator
public void createChildRowsThruIter() {
//Find the parent view object
ViewObject countries = findViewObject("Countries");
//IN is the Key value for a specific Country row
Key key = new Key(new Object[] { "IN" });
//Find the country for 'IN', maxNumOfRows=1
Row rows[] = countries.findByKey(key, 1);
//Access the RowIterator for Location
RowIterator locIter = (RowIterator)rows[0].
getAttribute("LocationVO");
//Create and init location row
Row row = locIter.createRow();
row.setAttribute("LocationId", 2200);
row.setAttribute("City", "Bangalore");
locIter.insertRow(row);
• Alternatively, you can directly create a new row in the child view object,
using createAndInitRow() by passing an appropriately constructed instance
of oracle.jbo.NameValuePairs, which includes the foreign key attribute
that provides the context for a child row. Here is an example:
//In application module implementation class
* This custom method defined in application module
* creates child location rows for a master
* country entity using createAndInitRow()
public void createChildRowsThruNameValuePairs() {
ViewObject locations = findViewObject("Locations");
//Initialize Attributes and Values
String[] attributes = new String[] { "CountryId" };
Object[] values = new Object[] { "IN" };
//Pass the foreign key value for Country while
//initializing new location row
Row locRow = locations.createAndInitRow(new
NameValuePairs(attributes, values));
//Set other attributes
locRow.setAttribute("LocationId", 2200);
locRow.setAttribute("City", "Bangalore");
locations.insertRow(locRow);
}

Similar Messages

  • Multi-row form with button to save and add another row

    Can you have a button on a multi-row tabular form that would save the current changes, and than open a new row up on the fom for a new entry to be entered? This would combine the save and add a row button functions.

    Add Row button is doing exactly what you are asking for - it will save the chages you
    made and add a new row.
    Denes Kubicek

  • JUCtrlHierNodeBinding: No matching node definition for row with key

    JDeveloper 11.1.2.0
    Model AM tester delivers data but trying to create search form and it returns empty set.
    <JUCtrlHierNodeBinding><convertRowsToNodes> [7342] JUCtrlHierNodeBinding: No matching node definition for row with key[PrimaryKey1]
    <JUCtrlHierNodeBinding><convertRowsToNodes> [7342] JUCtrlHierNodeBinding: Row class name :model.framework.MyViewRowImpl
    <JUCtrlHierNodeBinding><convertRowsToNodes> [7344] JUCtrlHierNodeBinding: No matching node definition for row with key[PrimaryKey2]
    <JUCtrlHierNodeBinding><convertRowsToNodes> [7342] JUCtrlHierNodeBinding: Row class name :model.framework.MyViewRowImpl
    <JUCtrlHierNodeBinding><convertRowsToNodes> [7346] JUCtrlHierNodeBinding: No matching node definition for row with key[PrimaryKey3]
    <JUCtrlHierNodeBinding><convertRowsToNodes> [7342] JUCtrlHierNodeBinding: Row class name :model.framework.MyViewRowImpl
    Where
    public class MyViewRowImpl extends ViewRowImpl {
    What would be wrong?

    when you are displaying the content in the table or treetable, is the primary column for VO available in pagedef?
    Can you ensure that the primary column for the VO is available in pagedef and re-run the page?
    Although, you will NOT be showing the keys in the UI page, But you would need it as part of the pageDef file.
    Thanks,
    Navaneeth

  • The iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library.

    I recently tried to look up my pictures on my time machine back up on an external hard drive. As soon as I try to open it I get the following message.
    "The iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library."
    I have tried holding down the option key but still couldn't few the photos.
    I want to know if there is anyway I can actually view these photos. I have over 85gbs of photos on the hard drive.  I have tried googling and looking at pervious forums with the same problem but nothing is working.
    Please help!

    Select Mac Help from the Finder's Help menu. Search for "Restore items backed up with Time Machine."

  • Error GR410: characteristic cannot be combined with key figures

    Hi,
    My problem is in Report Painter.
    I need to add selection by trading partner (or by vendor) in report 6OBU-001. For this Iu2018ve modified reporting table RWCOOM, in order to make available characteristic RASSC in the library 6O2.
    Iu2019ve added Trading partner in General selection of my own report (copy of 6OBU-001), but RP gives an error message: u201CCharacteristic RASSC cannot be combined with key figures. Check the report definition: the key figures used must be compatible with characteristic RASSC. For examples of useful combinations of characteristics and key figures, see the SAP standard reports.u201D
    Any opinions are truly appreciated.
    Anton

    I read this note before, but I still don't know how to write a ABAP code.
    I need information from table COEP like sum of qunatity or costs. I have this information for  Cost Elements and Orders in CCSS but I don't have for Materials.

  • [ME21] error message : cannot find message associated with key

    Dear all,
    I try to develop an Mobile application using smartSync,
    but when the application running (on client) got an error message :
    Error: 500
    Location: /UPLOAD_TEST/upload_testapp/Menu.do
    Internal Servlet Error:
    javax.servlet.ServletException: cannot find message associated with key : dispatcher.forwardException
    at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(RequestDispatcherImpl.java:238)
    at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:162)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:423)
    at 0002findex0002ejspindex_jsp_0._jspService(_0002findex_0002ejspindex_jsp_0.java:62)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    note:
    when create this application, I'm using tcode : merep_sbuilder
    Sync type : U01 - Upload using SMAPIs
    Bapi wrapper : MEREP_CONTACT_CREATE
    SAP Mobile Engine 2.1
    and generate .war file using MDK tool
    any one know about this ??
    thanks & regards,

    Hi,
    this error comes up when the destination serlvet throws an exception other than ServletException!
    Its a standard tomcat bug!
    Rgds Thomas
    -->
    http://issues.apache.org/bugzilla/show_bug.cgi?id=19114
    -->From apache.org:
    When a forwarded servlet throws an exception other than ServletException or
    IOException, the thrown exception is lost. This is due to the line:
    throw new ServletException(sm.getString("dispatcher.forwardException", t));
    (found in org/apache/tomcat/facade/RequestDispatcherImpl.java:210)
    the earlier catched t is here not passed into the constructor of
    ServletException but into getString.
    To reproduce construct a servlet that throws an Exception (other than
    ServletException and IOException) and another servlet that forwards to it. You
    will get just a forwardException (if you have the proper locale strings
    installed!) but the originally thrown exception will get lost forever.

  • SyncBo Example - cannot find message associated with key

    Hi,
    I followed the tuturial to create a SmartSync Project.
    And when I run the project I've got a Servlet Exception:
    javax.servlet.ServletException: cannot find message appropriated with key: dispatcher.forwardException.
    What I need to change?
    Thanks a lot,
    Rachid

    Hi,
    this error comes up when the destination serlvet throws an exception other than ServletException!
    Its a standard tomcat bug!
    Rgds Thomas
    -->
    http://issues.apache.org/bugzilla/show_bug.cgi?id=19114
    -->From apache.org:
    When a forwarded servlet throws an exception other than ServletException or
    IOException, the thrown exception is lost. This is due to the line:
    throw new ServletException(sm.getString("dispatcher.forwardException", t));
    (found in org/apache/tomcat/facade/RequestDispatcherImpl.java:210)
    the earlier catched t is here not passed into the constructor of
    ServletException but into getString.
    To reproduce construct a servlet that throws an Exception (other than
    ServletException and IOException) and another servlet that forwards to it. You
    will get just a forwardException (if you have the proper locale strings
    installed!) but the originally thrown exception will get lost forever.

  • How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    Hi j,
    I don't know if this will work, but I'd try logging in to an admin account, going to your main library (not user library), opening it, opening Application Support, selecting iPhoto, hold down the command key and press i, click on the lock in the lower left, entering the password and making sure you have Read & Write privileges for System and Admin.

  • I have a MacBook Pro with Snow Leopard. After connecting my HP Photosmart D110 to it, the printer works but the scanner doesn't. The message is"The scan cannot be performed because another program has control of the HP imaging device". Can anyone help?

    I have a MacBook Pro with Snow Leopard. After connecting my HP Photosmart D110 to it, the printer works but the scanner doesn't. The message is"The scan cannot be performed because another program has control of the HP imaging device". Can anyone help?

    Found the answer on the HP site. It's the original software that works with this printer OS X 10.6!!
    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en &cc=us&prodTypeId=18972&prodSeriesId=3558902&prodNameId=3562006&swEnvOID=219&swL ang=8&mode=2&taskId=135&swItem=ma-60835-3

  • Entity row with key oracle.jbo.Key is not found in EO

    Hi,
    We are using jDev 11.1.1.5.0.
    I am facing the issue Entity row with key oracle.jbo.Key is not found in my entity object.
    I have EO based VO and I am performing some operations on the VO. Based on user actions on UI, I need delete some records of the entity and I am using stored proc to delete those records and committing the changes in stored proc it self. After invoking stored procedure I am committing the changes performed in UI using ADF bindings.
    While invoking Commit from ADf I getting below error
    {code:java}
    <ADFLogger> <addContextData> Entity read all attributes
    <OracleSQLBuilderImpl> <rollbackToSavepoint> [139913] OracleSQLBuilder: ROLLBACK WORK TO SAVEPOINT 'BO_SP'
    <ADFLogger> <addContextData> Commit transaction
    <DCBindingContainer> <reportException> [139914] DCBindingContainer.reportException :oracle.jbo.RowAlreadyDeletedException
    <DCBindingContainer> <reportException> [139915] oracle.jbo.RowAlreadyDeletedException: JBO-25019: Entity row with key oracle.jbo.Key [204635 124 202810 N ] is not found in EO.
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:878)
      at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:553)
      at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8259)
      at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5964)
      at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6484)
      at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6665)
      at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3286)
      at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3089)
      at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2093)
      at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2374)
      at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1608)
      at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1416)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)
      at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2149)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
      at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
      at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
      at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
    {code}
    Please let me know if you have any pointers to resolve this.
    Thanks,
    Satya

    Where you are calling stored procedure which deletes records in the DB ?
    Try to override doDML() i your entity impl, as follows:
    protected void doDML(int operation, TransactionEvent e) {
         if(operation == DML_DELETE)    
              call_your_storedProc_here();
         else
             super.doDML(operation, e);
    Also, ensure that the procedure deletes the same set of records as well you in the middle tier.

  • Report Painter - Characteristic cannot be combined with key figures

    Hi,
    I have added a new field (ZZABTEI) to the report structure CCSS and using that field as a characteristic in the report. But when I execute the report, it is giving the error "Characteristic ZZABTEI cannot be combined with key figures". Can anyone help me to solve this issue.
    Thank you,
    Rekha

    There no code for this. I had to add the new field to CCSS structure. Then there were some configuration to be done. Then this message is got when the report in the report painter is executed. The details of this error message is as follows :
    Characteristic ZZABTEI cannot be combined with key figures
    Message no. GR410
    Diagnosis
    Characteristic ZZABTEI is being used in a report with a key figure that does not match this characteristic.
    System Response
    The system cancels generation.
    Procedure
    Check the report definition: the key figures used must be compatible with characteristic ZZABTEI. For examples of useful combinations of characteristics and key figures, see the SAP standard reports.
    Technical explanation: The Report Writer table assigned to the report is defined as a view with multiple database tables (somewhat similar to Report Writer table CCSS) and a key figure used in the report refers to a database table which does not contain characteristic ZZABTEI.
    Example 1 for table CCSS: If the 'cost' or 'quantity' key figures are used in a report (referring to tables COSP and COSS), you cannot use the 'Statistical key figure' (only occurs in table COSR) characteristic in the rows. On the contrary, using the 'Cost element' (tables COSP and COSS) characteristic is not permitted for the 'Statistical quantity' (table COSR) key figure.
    Example 2 for table CCSS: If a report only displays line item data (key figures IE... or PE...), you cannot use the 'PERBL' characteristic, because it is only valid for summary data. You have to use the 'PERIO' characteristic for line item data.
    Thank you,
    Rekha

  • Entity row with key oracle.jbo.

    hi am having this error when updating a record,am in Jdeveloper 11.1.1.6.0
    Entity row with key oracle.jbo.Key[707 ] is not found in Userdetail

    Isn't this the same problem than in (oracle.jbo.RowAlreadyDeletedException) JBO-25019: which seems to be solved?
    regards
    Peter

  • This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."

    This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."
    What did I do wrong?  I have been downloading all my photos into this same library since Janurary with no problems.

    What version of Mac OS X?
    Click the black Apple icon on the top left of the screen and select About This Mac. The next screen will show the information.

  • Need all the drivers and cannot change the brightness with keys

    my product name is hp 15-r250tu notebook i brought it a few days back all and the os i am useing is windows 7 ultimate all the drivers need to be installed but are not available on hp.com dont know why ? and i am not able to change the brightness with keys and cannot play games or videos video card off

    Hello,
    please have a look there: Adobe ID, sign in, and account help. If necessary and for further questions click through http://helpx.adobe.com/contact.html and if "open" please use chat, I had the best experiences. I quote from Preran: The chat button is activated as soon as there is an agent available to help.
    Good luck!
    Hans-Günter

  • I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    Hi...
    Mac OS X keyboard shortcuts
    Control-F4
    Move focus to the active (or next) window
    Shift-Control-F4
    Move focus to the previously active window
    By the way...  since you are new to Mac, click a clear space on your Desktop. You should see "Finder" top left corner of the screen in the menu bar.
    Click Help then click Help Center
    As an example type in    keyboard shortcuts
    You can use the Help menu for almost any application on your Mac.
    Apple - Find Out How - Mac Basics
    For held switching from PC to Mac >  Apple - Support - Switch 101

Maybe you are looking for

  • Is it possible to pull out a different text colour link in text?

    Is it possible to set two different colours for text, for example the body text is black and i'd like to highlight a link in the text lets say red and create a ur link for this text. The only way this seems to work is by creating a separate text div

  • How to un-sync a calendar and NOT delete ANY events?  Please help!

    Hi, I seem to be the only one with this problem. I search all over and can't find information for what I want to do, everyone wants to do the opposite. So basically I had a job and an iphone. I used my calendar at work for personal events and so fort

  • How to pull data from a c/c++ Application

    I am working on a project to instrument a product which runs on java as well as c/c++. Is there a way to pull data from a c/c++ application to a MBean? I am able to push the data through a custom TCP Adapter, But I could not get much help on a pull m

  • Unable to obtain 4G from my network with the Z10

    I recently purchased my z10 from verizon in the United States unlocked. When i inserted the sim card of my local network (4G plan) i was only able to identify an 'E'  in the upper right hand corner of the screen. After speaking with my network provid

  • Reading all the Exif data from TIFF Image

    Hi! I am trying to get Exif information out of an image. I succeeded partly because I get The Baseline (EXIF IFD0) and EXIF Sub IFD, but not the rest (The Maker Note, EXIF Interoperability IFD and IFD1). Can anyone tell me what I could try to get all