Insert master, then details

I'm using JDeveloper 10.1.3.5. I've set up ADF BC EO's and VO's for a master table and a detail table. There is also a 1:* Association, and a 1:* View Link between the master and details and this has all been added to an Application Module. The primary key of the master table is a surrogate PK generated from a sequence in a trigger. So the PK attribute has been designated as a DBSequence and has Refresh after Insert turned on.
I have a jspx page using ADF Faces. It has a Create Form based on the master table. That means that a Create action was added to the page definition, and an invokeAction set to make sure Create is done when the page is first displayed. I added an InputFile component set to an UploadedFile in a backing bean. The files that users will be uploading contain detail records to be associated with this master. So I added an Iterator, Create action named CreateDetail, and AttributeValues for each attribute in the detail table's VO to the page definition. There is also a Commit action in the page definition.
In the backing bean, there is an ActionEvent method tied to a commandButton on the page. It takes the uploaded file and executes CreateDetail for each record in the uploaded file, parses the record and sets the attributes. Then it executes Commit.
Here's the problem:
If I execute Commit before I start creating the detail records from the uploaded file, then Commit again after creating details, this works fine. However, if there is an error when I process the details, the master has already been committed. I'd rather consider master and details as a single transaction to be committed or rolled back as a unit.
If I don't commit before I start creating the detail records, the new primary key for the master record hasn't been retrieved yet. So the detail records don't have the foreign key that points to the master. So the commit fails - missing mandatory field.
I tried changing the Create on the master record to a CreateInsert, hoping that the framework would do the Insert of the master and retrieve its PK before processing the details, but no dice - it still works only if I Commit before processing details.
Any ideas?

In 11g, I've had some issues with compositions automatically maintaining foreign-key relationships for a sequence-based PK correctly if both master and detail are new. Have you tried implementing the (Java) solution provided by the aforementioned section of the dev guide (even though you shouldn't need it for compositions)?
If that doesn't work for you, I've found the "old" method to be successful:
In master:
public void postChanges(TransactionEvent e) {
/* Only references if this is NEW */
RowSet newDetailsBeforePost = null;
if (getPostState() == STATUS_NEW) {
// Store the rowset of details related
// to this new image before calling super
newDetailsBeforePost = (RowSet)getXXX(); // replace "getXXX" with your association accessor method
super.postChanges(e);
if (newDetailsBeforePost != null) {
adjustDetails(newDetailsBeforePost);
private void adjustDetails(RowSet details) {
Number newFkValue = getYYY.getSequenceNumber(); // replace "getYYY" with the getter for your sequence-based PK attribute
while (details.hasNext()) {
DetailImpl detail= (DetailImpl) details.next(); // replace "DetailImpl" with your detail EO class
detail.setZZZ(newFkValue); // replace "setZZZ" with the setter for the detail's FK attribute
In detail:
public void postChanges(TransactionEvent e) {
MasterImpl master = getMaster(); // replace "MasterImpl" with master EO class, "getMaster" with assoc accessor method
if (STATUS_NEW == master.getPostState()) {
master.postChanges(e);
super.postChanges(e);
Even better is to create an EO framework class that just fixes this problem (in general) for you, but that's more complicated--<plug>see the forthcoming JDev11g handbook</plug>.
Hope this helps,
Avrom

Similar Messages

  • Insert Master and Detail in the same transaction

    I have 2 view objects : Students and Enrollments.
    Connecting those view objects, there is one view link :
    Cardinality : 1..* (One student can enroll several courses).
    This link is exposed in "Students" view object by the property "getEnrollments" and in "Enrollments" view object, by the property "getStudent".
    I am try to insert records first in Student table, and Enrollment table in the same transaction.
    The primary key for Student table is generatade by a sequence (database trigger)
    My code is :
    StudentListImpl studentView = getStudentList();
    StudentListRowImpl studentRow = (StudentListRowImpl) studentView.createRow();
    studentRow.setFirstname(student.getFirstName());
    studentRow.setLastname(student.getLastName());
    studentRow.setDatebirth(student.getDateBirth());
    studentRow.setStatusid("A");
    studentView.insertRow(studentRow);
    EnrollmentListRowImpl enrollmentRow = (EnrollmentListRowImpl) studentRow.getEnrollments().createRow();
    enrollmentRow.setCourseid("C-100");
    studentRow.getEnrollments().insertRow(enrollmentRow);
    The generated Student ID is not being retrieved by ADF and set up in Enrollment view object. So, database is firing foreign key violation (in Enrollment table - No student ID provided)
    How can achieve this goal? Insert in DETAIL table with the key generated for the PARENT table?

    Yes, ID attribute in Student EO is DBSequence.
    If I insert only Student it works. But when I try to insert an Enrollment for that just created Student (same transaction), the Student ID is not assigned to Enrollment EO.
    The code I use to insert Enrollment is :
    EnrollmentListRowImpl enrollmentRow = (EnrollmentListRowImpl) studentRow.getEnrollments().createRow();
    enrollmentRow.setCourseid("C-100");
    My question is :
    Since I am creating a new Enrollment row using view link acessors in Student VO (getEnrollments), will the Student ID (just generated by sequence) be automatically assigned to Enrollment VO?
    I am totally lost about this (inserting master and detail in same transaction) and I can't find documentation on this topic.

  • Insert master and detail rows with Composition assoc generating JBO-26048

    I have the Master and Detail Entity Objects and made an Association linking them as Composition related.
    I have 2 ViewObjects. the MasterViewObject is composed of the Master entity object and 1 other udpateable object. the DetailViewObejct only contains the Detail entity Object.
    I tried to create a row on the masterviewobject and then immeidately create a detail row, and then commit, ADF issues a JBO-26048 error. Constraint "MY_FK" violated during post operation.... ".
    I don't know wahts wrong, but this should not be error should nit be appearing, as ViewObjects and the Links with Composition Association take care of populating the Foreign Keys of the detail. Or am I missing something here?

    The ADF Guide covers this problem, and I have a method that works as well on jdevguru.com. Take a look at the manual first, they have an indepth view on it and how to get it all to work together.
    Kelly

  • How to insert  new records in Master and detail Forms.

    Hi,
    I am having trouble inserting values in both master and detail view at the same time. The scenarios is I have a Dept Table (View Object-VO1) and Employee Table(View Object -VO2) both linked with a foreign key, as per Default HR schema in Oracle DB XE.
    Now I want to insert new record in both Dept(VO1) and EMP(VO2) table via a New page say ( Page2 ). There is a button on Page1 with button INSERT .I can only drag-drop "CreateInsert" operation on that button for VO1 or VO2. So only text box for Dept records are enable to insert data but not Emp records. Is there a way I can insert data in both the tables at the sametime??
    Thanks,
    MB

    Hi MuradRabbani,
    You can programmatically call both createInsert Operations,
    Add to your pageDef both CreateInsert Operations.
    Create a button tha will call insert method from Master (VO1) and then call insert method for Detail (VO2)
    Here is an Example code of calling the operations:
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer(); //you need ADFUtils.java and JSFUtils.java classes. You can find them in the sample applications in your JDeveloper.
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO1");
    oper.execute();
    -----------------NOTE: at this point you should have set values that compine the ViewLink on the master in order the detail will know where to link the new record there are many ways to do it.
    As an approach try to overrdi the create Method on the in the ViewRowImpl of your Master vo (VO1)
    e.g.
    @Override
    protected void create(AttributeList attributeList) {
    //before
    attributeList.setAttribute("NameOfAttribute", valueHere);
    super.create(attributeList);
    After that you should call the operation for your detail VO2
    e.g.
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer();
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO2");
    oper.execute();
    The detail record will now have the values from your master automatically.
    Regards,
    Dimitris.

  • Master detail form initial insert issue on details sub-region

    Hello,
    I created a master detail form with report which should do insertion on master and detail region/subregion.
    On insert mode I enter with data master and detail block, when I press "Create" button, insertion happens only on master block (order table) not and on detail block (order_item table).
    On EDIT mode it does insertions/updates on master and detail block without problems.
    Application Express 4.2.1.00.08
    Oracle Database 11g Express Edition Release 11.2.0.2.0
    I appreciate your help.
    Regards

    Something like this should do the work:
    CREATE OR REPLACE TRIGGER order_item_table_tr
       BEFORE INSERT
       ON order_item_table
       FOR EACH ROW
    BEGIN
       IF :NEW.order_id IS NULL
       THEN
          :NEW.order_id := v ('P1_ORDER_ID');
       END IF;
    END order_item_table_tr;
    /Make sure the Automatic Row Processing (DML) of the order table returns key into item > Return Key Into Item > P1_ORDER_ID (or however the primary key of the order table is named)
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Insert Master Detail

    Hi all,
    I need to understand which is the fastest way for inserting rows in master-detail tables
    Using a procedure. I often insert lots of details rows and sometimes master-details rows
    Here there is my solution. Is there something faster?
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    CREATE TABLE MAIN_TRACING (
       MAINVAL VARCHAR2(10) NOT NULL,
       PAR1    VARCHAR2(10) NOT NULL);
    CREATE TABLE TRACING_DET (
       MAINVAL   VARCHAR2(10) NOT NULL,
       SUBPAR1   VARCHAR2(10) NOT NULL);
    CREATE UNIQUE INDEX MYPK ON MAIN_TRACING(MAINVAL);
    ALTER TABLE MAIN_TRACING ADD ( CONSTRAINT MYPK PRIMARY KEY (MAINVAL) USING INDEX MYPK);
    ALTER TABLE TRACING_DET ADD ( CONSTRAINT MYFK FOREIGN KEY (MAINVAL)  REFERENCES MAIN_TRACING (MAINVAL));
    CREATE OR REPLACE PROCEDURE ADD_TRACE(V_MAINVAL VARCHAR2, V_PAR1 VARCHAR2, V_SUBPAR1 VARCHAR2)
    AS
       PARENT_NOT_FOUND   EXCEPTION;
       PRAGMA EXCEPTION_INIT(PARENT_NOT_FOUND, -2291);
    BEGIN
       INSERT INTO TRACING_DET(MAINVAL, SUBPAR1)
            VALUES (V_MAINVAL, V_SUBPAR1);
       COMMIT;
    EXCEPTION
       WHEN PARENT_NOT_FOUND
       THEN
          INSERT INTO MAIN_TRACING(MAINVAL, PAR1)
               VALUES (V_MAINVAL, V_PAR1);
          INSERT INTO TRACING_DET(MAINVAL, SUBPAR1)
               VALUES (V_MAINVAL, V_SUBPAR1);
          COMMIT;
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.PUT_LINE(' Error code    : ' || TO_CHAR(SQLCODE));
    END ADD_TRACE;
    EXEC ADD_TRACE('m1', 'a', 'suba1');
    EXEC ADD_TRACE('m1', 'a', 'suba2');
    EXEC ADD_TRACE('m1', 'a', 'suba3');
    --exec ADD_TRACE('m1', 'b', 'suba3'); --IMPOSSIBLE!
    EXEC ADD_TRACE('m2', 'b', 'subb1');
    EXEC ADD_TRACE('m2', 'b', 'subb2');
    SELECT * FROM MAIN_TRACING;
    MAINVAL    PAR1
    m1         a
    m2         b
    SELECT * FROM TRACING_DET;
    MAINVAL    SUBPAR1
    m1         suba1
    m1         suba2
    m1         suba3
    m2         subb1
    m2         subb2

    The answer (as Tom Kyte is fond of stating) is "It depends" ;-)
    Is this something that is called scattered over the application? Most of the time it will be called with an existing MAINVAL and just sometimes now and again a new MAINVAL will be inserted? Subsequent calls to ADD_TRACE will typically have a different MAINVAL than the previous call?
    If that is the case, then your method is not a bad one. Many programmers would have first tested for existence of master and decided whether to insert it or not, which would then be wasted effort in 95% of the cases.
    Your method of assuming the master exists and then handle the exception if it does not - that is quite neat. But the key is - it has to be the exception to the rule that the exception handler is invoked.
    But if on the other hand you are calling ADD_TRACE pretty consecutively (sort of like your example) with first several calls with one MAINVAL, then several calls with a new MAINVAL, then several with a new MAINVAL, etc. - say a typical ETL process or loading data from perhaps a flatfile or something like that - then you would do better to do one insert of the parent and then bulk up the children in a bulk insert.
    So it depends on your use case. There is not one generally best way to insert into master-detail - there will be several depending on whether you are bulk loading data to your master-detail or you have scattered calls.
    But just one other thing concerning your code:
    Usually it is not a good idea to issue those COMMIT statements inside your procedure. How do you know if the caller has finished with the transaction or not?
    Either let the client/caller decide when the complete transaction is done.
    Or you may decide that this is tracing/logging and should be logged no matter whether the calling transaction commits or rollbacks, and then you can make ADD_TRACE use an autonomous transaction.
    (All of the above is just my personal opinion and you will likely find other people with different opinions ;-) )

  • BC4J - Inserting Master/Detail records in same transaction.

    I know this is possible, but I seem to be missing something to allow it to happen within BC4J.
    I'm creating a RowSet off of a View Object and inserting new Rows into this RowSet. This RowSet represents my child/detail records for insert into a child table.
    I then create a new Row off of another View Object. This row represents my Master/parent record for insert into a parent table.
    All of the above is being done in the same applicationModule transaction with locking mode set to Optimistic.
    Before I commit the transaction, I grab the next sequence # to use as the primary key for the master record and the foreign key for the child records. I apply those to the newly created child rows and the newly created master row.
    However, when I commit I continue to get a JBO-26041: Failed to post data to database during "Insert": error due to ORA-02291: integrity constraint (CUST_LICENSES_FK4) violated - parent key not found
    If everything was created in the same transaction, why won't this allow me to insert into both tables with the correct primary/foreign keys? It's almost as if the child records are being inserted first prior to the parent record.
    Any ideas?
    Thanks in advance..
    Teri Kemple
    TUSC
    [email protected]

    However, when I commit I continue to get a JBO-26041: Failed to post data to database during "Insert": error due to ORA-02291: integrity constraint (CUST_LICENSES_FK4) violated - parent key not found
    If everything was created in the same transaction, why won't this allow me to insert into both tables with the correct primary/foreign keys? It's almost as if the child records are being inserted first prior to the parent record.This is due to the order of rows being posted. In this case it seems the detail row is getting posted before the master.
    To avoid such situations, either you may implement your own post ordering by making sure that when a detail is to
    be inserted, it's master is inserted or you may use "Composition Association" flag in the association wizard between
    the master and the detail entities to let the framework manage a tight composition relationship between the two entity
    types. BTW, there was another definitive thread recently on inserting master-detail in the
    same transaction, but the forum search engine is so useless I can't find it. Anyone
    have the msgid handy or know how to find that thread again??
    FYI: the help describes the Composition flag functionality in terms of the Master record already existing in the DB. In our problem here, the Master is being inserted in the same transaction. Thus needs to be posted FIRST.
    I got a integrity constraint exception too, then set the composition flag and now I get:
    500 Internal Server Error
    oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
         void oracle.jbo.server.EntityImpl.create(oracle.jbo.AttributeList)
         void gov.ga.gdc.otf.bc.JotfWithdrawalsImpl.create(oracle.jbo.AttributeList)
         void oracle.jbo.server.ViewRowStorage.create(oracle.jbo.AttributeList)
         void oracle.jbo.server.ViewRowImpl.create(oracle.jbo.AttributeList)
         oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstance(oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
         oracle.jbo.server.RowImpl oracle.jbo.server.QueryCollection.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.AttributeList)
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRow()
         oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.createRow()
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.insertWithdrawal(java.lang.String, java.lang.String, java.math.BigDecimal, oracle.jbo.domain.Number, java.lang.Integer, int)
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.payOneObligation(java.lang.String, java.lang.String, java.lang.Integer, oracle.jbo.domain.Number, java.math.BigDecimal, int)
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.payObligations(java.lang.String, java.lang.String, java.math.BigDecimal, oracle.jbo.domain.Number)
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.receiveFunds(java.lang.String, java.lang.String, int, java.math.BigDecimal, java.lang.String, java.lang.String, java.lang.String, java.math.BigDecimal, long)TIA much! curt

  • Spry insert master/detail layout Can't get more than two columns?

    Ive been trying to get more than two columns just experimenting with spry data sets and can't with the layout option "insert master/detail layout"
    What am I doing wrong?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    var ds1 = new Spry.Data.HTMLDataSet("benefitsdata.html", "bizben", {firstRowAsHeaders: false});
    </script>
    </head>
    <body>
    <div align="center">
      <div class="MasterDetail">
        <div spry:region="ds1" class="MasterContainer">
          <div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{column0}</div>
        </div>
        <div spry:detailregion="ds1" class="DetailContainer">
          <div class="DetailColumn">{column1}</div>
          <div class="DetailColumn">{column2}</div>
          <div class="DetailColumn">{column3}</div>
        </div>
        <br style="clear:both" />
      </div>
    </div>
    </body>
    </html>

    Hello,
    in addition to Sudarshan's statement about the discontinued support: In my SPRY library I found this "html_dataset_sample". Maybe it could help you. Here the source code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var ds1 = new Spry.Data.HTMLDataSet("benefitsdata.html", "bizben", {firstRowAsHeaders: false, useCache: false, tableModeEnabled: false, sortOnLoad: "column0", sortOrderOnLoad: "ascending", rowSelector: "tr.destroyed", dataSelector: "td"});
    ds1.setColumnType("column2", "number");
    ds1.setColumnType("column3", "number");
    ds1.setColumnType("column4", "number");
    //-->
    </script>
    </head>
    <body>
    <div spry:region="ds1">
    <table>
      <tr align="center" valign="middle">
       <th width="100" spry:sort="column0">Name</th>
        <th width="100" spry:sort="column1">Class</th>
       <th width="100" spry:sort="column2">Length(m)</th>
       <th width="100" spry:sort="column3">Crew Size</th>
       <th width="100" spry:sort="column4">Crew 1</th>
    </tr>
      <tr align="center" valign="middle" spry:repeat="ds1">
       <td width="100"><p>{column0.1}{column0.2}{column0.3}</td>
         <td width="100">{column1}</td>
       <td width="100">{column2}</td>
       <td width="100">{column3}</td>
       <td width="100">{column4}</td>
    </tr>
      </table>
    </div>
    </body>
    </html>
    Hans-Günter

  • TooManyObjectsException inserting master-detail composed entities

    Hi all,
    I have read something similar in the blog, but I can't solve my problem.
    I am using JDev 11.1.1.0.2 and I have thi situation:
    1) a page where I can edit data, and pushing a button I can create a new record
    2) clicking on this button, starts a bounded task-flow (train) where I insert master (before) and detail (after) data.
    I have checked composition flag in the associations that links the two entities
    When I try to commit I have this error:
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[... ].
         at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:431)
         at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:818)
         at oracle.jbo.server.EntityCache.add(EntityCache.java:404)
         at oracle.jbo.server.ViewRowStorage.entityCacheAdd(ViewRowStorage.java:2551)
         at oracle.jbo.server.ViewRowImpl.entityCacheAdd(ViewRowImpl.java:3139)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:2911)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:2764)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:1931)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:4508)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2899)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2755)
         at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:2996)
         at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:2453)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1047)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:873)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2738)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2715)
         at oracle.jbo.server.ViewRowSetIteratorImpl.getAllRowsInRangeInternal(ViewRowSetIteratorImpl.java:2101)
         at oracle.jbo.server.ViewRowSetIteratorImpl.getAllRowsInRange(ViewRowSetIteratorImpl.java:2148)
         at oracle.jbo.server.ViewRowSetImpl.getAllRowsInRange(ViewRowSetImpl.java:2730)
         at oracle.jbo.server.ViewObjectImpl.getAllRowsInRange(ViewObjectImpl.java:9131)
         at oracle.jbo.server.ViewRowSetImpl.findByViewCriteriaWithBindVars(ViewRowSetImpl.java:5191)
         at oracle.jbo.server.ViewRowSetImpl.findByViewCriteria(ViewRowSetImpl.java:4950)
         at oracle.jbo.common.AbstractListBinding.filterList(AbstractListBinding.java:580)
         at oracle.jbo.common.AbstractListBinding.filterList(AbstractListBinding.java:470)
         at oracle.jbo.server.RowImpl.applyListBindings(RowImpl.java:901)
         at oracle.jbo.server.RowImpl.checkAndApplyListBindings(RowImpl.java:601)
         at oracle.jbo.server.ViewObjectImpl.afterRowUpdate(ViewObjectImpl.java:11240)
         at oracle.jbo.server.ViewObjectImpl.sourceChanged(ViewObjectImpl.java:11492)
         at oracle.jbo.server.EntityCache.sendEvent(EntityCache.java:1150)
         at oracle.jbo.server.EntityCache.deliverEntityEvent(EntityCache.java:1164)
         at oracle.jbo.server.EntityCache.notifyColumnAndBlgChange(EntityCache.java:1220)
         at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:6781)
         at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:6762)
         at oracle.jbo.server.EntityImpl.populateAttribute(EntityImpl.java:6486)
         at oracle.jbo.server.EntityImpl.refreshFKInNewContainees(EntityImpl.java:5575)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:514)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:7779)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6162)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3253)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3061)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2180)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2382)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1565)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1407)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1293)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2126)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:697)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:392)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:159)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:118)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1227)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:70)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:274)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:74)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:70)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:274)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:74)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:640)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:275)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:102)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    I have solved.
    I have to flag the composition association in the entity object

  • Master and detail in the same page

    db11xe , apex 4.0 , firefox 24 ,
    hi all ,
    i am trying to insert the master and detail data in one step in the same page :
    i have two tables (clients) and (tests_administered)
    the client table's region contains theses items
    client_id
    client_name
    the other table's region contains these columns -- the tabular region
    row selector
    test_admin_id -- pk,  hidden
    client_id          -- hidden , this is the one i should populate with values
    and more columns
    i've done this :
    1- removed the condition of the tabular region .
    2- Added the request CREATE to the list in condition of the APPLYMRU process -- or :request like ('CREATE')
    3- Added new process with following code : -- with sequence before the applymru process and after process row of clients process
    for i in 1..apex_application.g_f02.count
    loop
    apex_application.g_f02(i) := :p2_client_id ;
    end loop ;
    but nothing happened . why ? what did i miss ?
    thanks

    Hi,
    Create a Master Detail Form through the APEX Wizard 
    Make sure you choose the Primary Keys for the Master Detail as one of your Column and not the ROW ID.
    Selecting an existing Sequence for the Primary Key is preferred.
    Select the option the where your Master and Detail appears in the same page.
    Initially when you run the page your master and detail will not appear at the same time in the page when your Master Detail Form is in the entry form mode. For this you have to go to your Tabular Form(Detail Form) region, and below you will have to remove the Condition for the display of your Tabular form and set it to “No Condition”.
    Now when you run the page both the Master and Detail form will appear together in the create mode but you will not be able to insert or create both master and detail records at the same time when u click the create button. For this the following needs to be done: You need to create a PL SQL Tabular Form process :
    Let's say your master form is based on DEPT and your detail tabular form is based on EMP. Make sure the following things are configured:
    The DEPT insert/update DML process runs before the new tabular form PLSQL process. (ie) the new PL SQL Tabular Form Process that you create should be inbetween Automatic Row Processing(DML) and Multi Row Update Process , so create the new Tabular Form Pl SQL process with a sequence number inbetween these two Processes.
    Make sure you choose Tabular form while creating this PL SQL process.
    The new tabular form PL/SQL process executes the following as the source
       :DEPTNO := :P1_DEPTNO;
    Where DEPTNO is the Foreign Key column in the Tabular Form that links the Primary Key Item P1_DEPTNO of the Master Form.
    Finally this new PL SQL process conditionally runs when DEPTNO is null, so you need to add the following condition to the process:
    The final step to accomplish in creating both the Master and Detail records at the same time is to make a change in the condition of the Multi Row Update Process. :request in ('SAVE','CREATE') or :request like 'GET_NEXT%' or :request like 'GET_PREV%'
    -We make this change so that records get inserted into the Detail table when we click the ‘’Create” button.
    Now you can Run your page and create both the Master and Detail records at the same time.
    Thanks and Regards,
    Madonna

  • Master table detail table with SQL based read only VO with bind variables

    i have a page where i am displaying data as master table and detail table. both table VOs are based on SQL queries which use bind variables.
    i have a view link between vos of type 1:M
    i created master table detail table page by dropping detail iterator from data control panel under master and selecting master table detail table
    on my page i see detail table records getting populated only for first record of parent table.
    on changing parent record, child table shows same records and does not refresh
    i am using partial triggers on both tables to be populated on a button click as i need to pass some bind variables to VOs which are taken as input from users
    how can i show corresponding rows in detail table when parent record in table changes
    is it possible declaratively to have master detail table view when both VOs have bind variables
    jdev 11 1 1 5
    these are the SQLs used
    Parent SQL Based VO Query
    SELECT to_char(d.status_date,'yyyymmddhh24') TIME123, count(DISTINCT d.c4)
    FROM t1 d,
    t2 w
    WHERE w.c1 = nvl(:ou, w.c1)
    AND UPPER(w.c2) = UPPER(nvl(:tt, w.c2))
    AND d.c3 >= :startTime AND :startTime IS NOT NULL
    AND d.c3 <= :endTime AND :endTime IS NOT NULL
    AND d.c4 = w.c4
    AND UPPER(d.status) = 'CLOSED'
    GROUP BY to_char(status_date,'yyyymmddhh24') ORDER BY to_char(status_date,'yyyymmddhh24') DESC
    Child SQL Based VO Query
    SELECT w.c1,
    w.c5 - w.c6 processing_time,
    w.c3,
    w.c6,
    w.c7,
    w.c8,
    to_char(d.status_date,'yyyymmddhh24') TIME123 FROM t1 d,
    t2 w
    WHERE w.c2 = nvl(:ou, w.c2)
    AND UPPER(w.c3) = UPPER(nvl(:tt, w.c3))
    AND d.c4 >= :startTime AND :startTime IS NOT NULL
    AND d.c4 <= :endTime AND :endTime IS NOT NULL
    AND d.c1 = w.c1
    AND UPPER(d.status) = 'CLOSED' ORDER BY to_char(status_date,'yyyymmddhh24') DESC
    view link is based on column TIME123

    Instead of doing the master-detail layout by dragging the details over, can you try a new page where you first drag the master VO over and then drag the detail VO over, and then set partialTrigger from the detail to point to the master?

  • Vendor Master CIN Details Tab

    Dear All,
    Where will we do the field settings for the fields in Vendor Master CIN Details Tab?
    Points will be awarded.
    Thanks in advance!
    SAP FC

    Hi,
    U want the Cin tab on the vendor master rite.
    It comes on the address screen.
    In the spro under LG -- tax on goods movement---india...
    drop down and u have a place where we give ur user id ... (new entry) gv ur user id and put a star * and save.
    then when u create vendor master now u will get the CIN tab.
    I have no sap so i could not tell u the exact path.
    Thanks & regards,
    Kiran

  • MySQL Sytax error with master and detail pages

    Master and Detail pages.
    I get an SQL error when I click on an Item in the Master
    page.
    “You have an error in your SQL syntax; check the manual
    that corresponds to your MySQL server version for the right syntax
    to use near 'ID = 16 LIMIT 0, 10' at line 1 “
    If I try to open the detail page I get
    “You have an error in your SQL syntax; check the manual
    that corresponds to your MySQL server version for the right syntax
    to use near 'ID = -1 LIMIT 0, 10' at line 1 “
    I created this pair by simply clicking on Insert/data object/
    master detail page.
    I have tried this various ways, but always get the same
    result.
    Is there a bug in CS3?

    Sorry I have solved it myself.
    I had accidentally put a space in a table header in the mySQL
    data bank.
    All works well now.

  • Master table / detail table: Problem refreshing the content

    Hi,
    I have a Master table/detail table on my page. When I add a new row to the master or detail table, the new row is inserted in the database, but not shown in the ADF Tables on the page. After restarting the OC4J the ADF Tables show the correct data, including the new rows.
    While dropping the collection on my page there were one methodIterator and two accessorIterators created.
    In several tutorials the solution for the refresh problem is to change the chacheResult parameter of the methodIterator to false. But this causes in "No row found for rowKey:null" errors.
    An other solution should be to create a new invokeAction with the id "tableRefresh" and the corresponding RefreshConditions. This doesn't helps, too.
    So how could I solve this problem? I want to update/refresh the master and detail table, after I inserted a new row.
    Thanks,
    Thomas

    Hi,
    thanks for your answer.
    Sorry, but I forgot to say, that I am using Jdev 10.1.3.1, Toplink, ADF and EJB3.
    I think I will give some further informations about the scenario. I created the m/d table by drag-and-droping the object out of the data control palette on site A. Each row stores a goLink item, which navigates to a new page B. After creating and saving the new entry the user navigates back to the page with the m/d table (page A). Storing the new entry is handled by an action in the page B managed bean.
    Now the question: How could I re-execute in page B backing bean the iterator which is stored in page A? Could this be handled by an invokeAction? Or is it possible to get access to the iterator used and stored on another page (definition)?
    Thanks,
    Thomas

  • Master with Detail Tab Pages

    I have a master with multi-detail pages. I would like to have the master record appear on the top of each screen and have the user select one of the multi-tab pages to select which detail information they would like to see.
    Is this possable with Forms 6i and if so how do I put them together. When I tried to create the form I could see the master and detail together ONLY when I navigated to the detail records.
    To carry this a step further is it possable to have Multi-masters each with their own tab and each master have detail tab pages?
    Thanks

    You could try the following:
    Create 1 canvas and place the header items on the top portion. Create another canvas - Tab type and place or create all you tabs with the details on then. Then stack the tab canvas on top of the main header canvas, resize so that the header is visible an that is it.

Maybe you are looking for