Master/ Detail FK Constraint Exception
BC4J and Jclient app with 1 master and ten detail tables that are all updated in the same transaction using database sequances. It seems that a temp sequance is issued correctly to all details and then on a commit when the master recieves it seq from the database that the details FK fields are not updated with the final master seq. What is the recommended method for handling this type of one to many update with jclient and bc4j?
Thanks in advance.
This is just an educated guesstimate:
There may be a better way, but I would try one of the following:
1. Modify the "aftercommit" method in your Masters entity object to set the details fk fields with the sequence returnd from the transaction. (You'll have to fiddle with this as I have never tried it!). If there is no afterCommit method in your Entityimpl.java file then select Tools|Override Methods and expand the oracle.jbo.server.EntityImpl line. Check the box beside "afterCommit" and click okay.
-OR-
2. Before commiting the transaction. Manually retrieve the next sequence value from the DB and set the key of the Master from this value. I think that should do it.
~Rob Lundeen
Similar Messages
-
Master-Details form - integrity constraint
Hi,
I have created a simple master-detail form. Master block is based on say Table1 with 2 columns and detail block is based on Table2 with 4 columns.
When I am trying to create records using this form, I enter data in the Master block and then navigate to the detail block and then enter data. When I press the save button,
the form throws error message "ORA-02291: integrity constraint (APPS.FK_RECORD_IDENTIFIER) violated - parent key not found"
When I check the query using Help->Diagnostics->display database error, the insert statement is insert into table2 values (......
I guess, the form is trying to insert data into table2 first. Since there is no corresponding entry in Table1, hence the error. What should be done, so that the form inserts Master block data into table1 first before attempting to insert data into detail block.
Regards
SureshSuresh,
In the Object Navigator view, check the block order under the Data Blocks section. The Master Block should come first, and then only the detail should come. If its is not like that, then change the order of the blocks by dragging the master block to top of the blocks.
Regards,
Manu.
If my response or the response of another was helpful or Correct, please mark it accordingly -
Master-details query to XML file?
Hi:
I'm new in XML and Oracle. I want to create XML file from two tables (master-details).
I made a small serach and tried some examples:
Say we have these tables:
CREATE TABLE "TEST_XML"
( "ID" NUMBER,
"NAME" VARCHAR2(15),
"AMOUNT" NUMBER,
CONSTRAINT "TEST_XML_PK" PRIMARY KEY ("ID") ENABLE
CREATE TABLE "TEST_XML2"
( "ID2" NUMBER,
"NAME2" VARCHAR2(20),
"AMOUNT2" NUMBER
ALTER TABLE "TEST_XML2" ADD CONSTRAINT "TEST_XML2_FK" FOREIGN KEY ("ID2")
REFERENCES "TEST_XML" ("ID") ENABLE
INSERT INTO TEST_XML VALUES (1,'A',50);
INSERT INTO TEST_XML VALUES (2,'B',30);
INSERT INTO TEST_XML VALUES (3,'C',70);
INSERT INTO TEST_XML2 VALUES (1,'AA',10);
INSERT INTO TEST_XML2 VALUES (1,'AB',20);
INSERT INTO TEST_XML2 VALUES (1,'AC',20);
INSERT INTO TEST_XML2 VALUES (2,'BA',10);
INSERT INTO TEST_XML2 VALUES (2,'BB',20);
INSERT INTO TEST_XML2 VALUES (3,'CA',20);
INSERT INTO TEST_XML2 VALUES (3,'CB',40);
INSERT INTO TEST_XML2 VALUES (3,'CC',10);
I want a query to create XML file contains data from TEST_XML table and for each row the related data from TEST_XML2 table.
I did some tries (working in iSQL*PLUS):
SET SERVEROUTPUT ON
DECLARE
v_ctx DBMS_XMLGEN.ctxType;
v_file Utl_File.File_Type;
v_xml CLOB;
v_more BOOLEAN := TRUE;
BEGIN
-- Create XML document from query.
v_ctx := DBMS_XMLGEN.newContext('select id,name,amount,cursor (select id2,name2,amount2 from test_xml2 t2 where t2.id2=t1.id) val from test_xml t1');
DBMS_XMLGEN.setMaxRows(v_ctx, 10);
DBMS_XMLGEN.setRowsetTag(v_ctx, 'CLAIM');
-- Output XML document to file.
v_file := Utl_File.FOpen('TEST_DIR', 'test1.xml', 'w');
WHILE v_more
LOOP
v_xml := DBMS_XMLGEN.GetXML(v_ctx,0);
EXIT WHEN dbms_xmlgen.getNumRowsProcessed(v_ctx) =0;
Utl_File.Put(v_file,v_xml);
END LOOP;
Utl_File.FClose(v_file);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,1,255));
Utl_File.FClose(v_file);
END;
But hte output wasn't as I wanted:
<CLAIM>
<ROW>
<ID>1</ID>
<NAME>A</NAME>
<AMOUNT>50</AMOUNT>
<VAL>
<VAL_ROW>
<ID2>1</ID2>
<NAME2>AA</NAME2>
<AMOUNT2>10</AMOUNT2>
</VAL_ROW>
<VAL_ROW>
<ID2>1</ID2>
<NAME2>AB</NAME2>
<AMOUNT2>20</AMOUNT2>
</VAL_ROW>
<VAL_ROW>
<ID2>1</ID2>
<NAME2>AC</NAME2>
<AMOUNT2>20</AMOUNT2>
</VAL_ROW>
</VAL>
</ROW>
<ROW>
<ID>3</ID>
<NAME>C</NAME>
<AMOUNT>70</AMOUNT>
<VAL>
<VAL_ROW>
<ID2>3</ID2>
<NAME2>CA</NAME2>
<AMOUNT2>20</AMOUNT2>
</VAL_ROW>
<VAL_ROW>
<ID2>3</ID2>
<NAME2>CB</NAME2>
<AMOUNT2>40</AMOUNT2>
</VAL_ROW>
<VAL_ROW>
<ID2>3</ID2>
<NAME2>CC</NAME2>
<AMOUNT2>10</AMOUNT2>
</VAL_ROW>
</VAL>
</ROW>
<ROW>
<ID>2</ID>
<NAME>B</NAME>
<AMOUNT>30</AMOUNT>
<VAL>
<VAL_ROW>
<ID2>2</ID2>
<NAME2>BA</NAME2>
<AMOUNT2>10</AMOUNT2>
</VAL_ROW>
<VAL_ROW>
<ID2>2</ID2>
<NAME2>BB</NAME2>
<AMOUNT2>20</AMOUNT2>
</VAL_ROW>
</VAL>
</ROW>
</CLAIM>
Notice that for each details (from TEST_XML2) there is <VAL> tag which I don't need beside i want a query which is applicable on all environments.
May anyone help me please......
Regards,
SaadThe following looks like it produces your desired output. I used the WITH to simulate your two tables so I didn't have to CREATE them. This runs on 10.2.0.1. I'm not sure what bugs you are referring to as SQL/XML is stable in 10g that I have seen. I'm sure some bugs exist somewhere in it, just not with this usage. Just start with the SELECT statement to run on your system.
WITH test_xml AS
(SELECT 1 ID, 'A' name, 50 amount FROM DUAL UNION ALL
SELECT 2, 'B', 30 FROM DUAL UNION ALL
SELECT 3, 'C', 70 FROM DUAL),
test_xml2 AS
(SELECT 1 ID2, 'AA' name2, 10 amount2 FROM DUAL UNION ALL
SELECT 1, 'AB', 20 FROM DUAL UNION ALL
SELECT 1, 'AC', 20 FROM DUAL UNION ALL
SELECT 2, 'BA', 10 FROM DUAL UNION ALL
SELECT 2, 'BB', 20 FROM DUAL UNION ALL
SELECT 2, 'BC', 20 FROM DUAL UNION ALL
SELECT 3, 'CA', 20 FROM DUAL UNION ALL
SELECT 3, 'CB', 40 FROM DUAL UNION ALL
SELECT 3, 'CC', 10 FROM DUAL)
SELECT XMLElement("CLAIM",
XMLAgg(
XMLElement("ROW",
XMLForest(id "ID",
name "NAME",
amount "AMOUNT"),
(SELECT XMLAgg(XMLElement("VAL_ROW",
XMLForest(id2 "ID2",
name2 "NAME2",
amount2 "AMOUNT2")))
FROM test_xml2 t2
WHERE t2.id2=t1.id)
FROM test_xml t1This solution works in any environment where you can issue a SQL statement from, be it SQL*Plus, PL/SQL, Java, etc. -
Master Detail page. - Create Row.
Hi
I have created a master details search page using the following BC4J objects
EmployeeEO - empId,name,deptno
DepartmentEO - deptno,deptname
EmpToDeptAO - using deptno
EmployeeVO - contains all Attributes of EmployeeEO
DepartmentVO -contaiins all Attribute of DepartmentEO
EmployeeAM contains both VO
The search page is working fine.
In the Search page i have created a create button.When this click this button will be forwarded to create page.
In the create page under the pagelayout region i have two table regions
one Employee Details Entry and the second one deparment details entry.
i have added apply button to the page.
in Process request of controller i have invoked the two create(insert row) methods (one for employeeVO and another for departmentVO)which resides in AM.
in process form request when apply button is pressed, i will commit the details.
Employee details getting committed but department details is not getting committed.Its throwing some exception like the Fonreign Key constraint violated.
but if i give some department no which is already existing in department table region both is getting committed.
How to handle this problem.
how to issue commit separately for master and detail.
Am i clear with the explanation.
Edited by: user10613877 on Dec 13, 2008 9:04 AMI guess you will also need a View Link between the the 2 VOs.
Also the attributes that would be used to join, should be declared as Key Attributes. Here in your case, Dept_Id should be the key Attribute in both the VOs.
You can refer this link.
[master-detail mandatory steps|http://apps2fusion.com/at/ps/333-oa-framework-master-detail-region-mandatory-steps] -
Creating master-detail VO in custom AppModule method
Hi.
I need to create master-detail view objects and save them in DB in my custom AppModule Service Interface method.
I have the next master-detail view objects:
RegistryVO (1) -- (*) RegistryItemVO
Also I have a view link for this relationship.
I wrote custom method with next signature:
Integer createRegistry(RegistryVORowImpl registry) {
Then, I added this method to my AppModule Service Interface.
Method works fine, but only master row is created and inserted to DB (only Registry but not RegistryItem). I.e. when I testing this method in EM I fill full RegistryVO with nested RegistryItemVO data but in my method RegistryVO comes without nested RegistryItemVOs.
Then, I added SERVICE_PROCESS_CHILDREN custom property to view link (RegistryVO-RegistryItemVO) as it described in chapter 11.2.5 of Fusion Developer 's Guide for Oracle Application Development.
After that nested RegisttryVO in my method contains nested RegistryItemVOs.
In my custom method i need to set primary key for RegistryVO. So I set it in registryVO to PK attribute and set it in nested registryItems to FK attribute.
But when I doing commit I have an exception:
Exception while executing the business logic: JBO-26048: Constraint "PP_PST_RG_IT_PP_PST_FK" is violated during post operation "Insert" using SQL stat
ement " *INSERT INTO PP_PERSON_ST_RG_ITEM* (PP_PERSON_ST_RG_ITEM_ID,IN_DOCUMENT_ID,POL,FULLNAME,NAME,FULLOT,TIN,D_ROG_DT,D_REEST
_DT,PROCESSING_DT,PROCESSING_STATE_CD,RECEIVE_YEAR) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12)".: ORA-02291: integrity
constraint (PP_PST_RG_IT_PP_PST_FK) violated - parent key not found
It seems that only registryItems are commited in DB. I'm not seeing INSERT for Registry in ServieInterface log...
But if I setting primary key for RegistryVO when I invoking method (if I setting id for registry in test console of EM, not in method) - it's work fine .
What I'm doing wrong ?
How can I create custom method for AppModule Service Interface to create master-detail view objects and set PK for master and FK for details within method ?
Edited by: user2975420 on 19.10.2010 4:46
Edited by: user2975420 on 19.10.2010 4:49Thanks for reply, John.
I have already added master and detail view objects usages to my AppModule Data Model. And yes, I add detail VO as child of master.
It seems that the reason of my problem is another...
I can't create master/detail when I'm setting id of master in custom method. If I set id of master in input parameter (RegisterVORowImpl) then method invokes successfull.
I noted one moment - if I'm not setting SERVICE_PROCESS_CHILDREN custom property for view link, I can set id of master VO inside method. But in this case my master VO haven't got nested RegisterItemVOs.
Edited by: user2975420 on 19.10.2010 10:23
Edited by: user2975420 on 20.10.2010 1:31 -
Populate PK(DBSequence) in three related tables with master detail association
Hi
I use jdeveloper 11.1.1.6.0.
My English isn't very good.
I have 3 tables with master detail association between them and primary key from table A should populate to tables B and finally C .The primary key is a sequence from data base and I set PK attribute in table A as a DBSequence. (table C is the child of table B and table B is the child of table A)
My association is like this: A->B(BAFk1Assoc) and B ->C(CBFk1Assoc) and also I select Composition Association for these two association. And I select ‘Cascade Update Key Attribute’
When I insert row in these three related tables, a negative number create but when I COMMIT the PK populate only to table B not to table C and the exception below raises:
Constraint "C_B_FK1" is violated during post operation "Insert"
ORA-02291: integrity constraint (HR.C_B_FK1) violated - parent key not found.
If I only work with tables A and B, there isn't any problem but if I add table C as the child of B, this exception raises.
HabibThe question is how you create the row for table C. Do you create it as child from table b (using the VO for B and using the link to C)?
In this case the framework should populate the PK of the master row B as FK in table C.
You may need to control the order in which the rows are posted to the DB to avoid this problem. Read Advanced Entity Object Techniques - 11g Release 1 (11.1.1.6.0) to get more info about this.
However, sometimes it's easier to control the generation and setting if the PK attributes in the model layer, not relating on db triggers where you get the real values only after the commit operation is done in the db. For this you can use a Groovy expression so you have access to the PK of each new created row right after creation. Read Using Groovy Expression to set a Primary Key with a Sequence Number | JDev &amp; ADF Goodies to find out how to do this.
Timo -
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 subb2The 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 ;-) ) -
Master detail form - Cascade Delete gives error
I am using 3.0.9.8.2 and have made a master detail form which works fine except for cascade delete. Insert and update works well, but I have to delete the child rows first to be able to delete the parent.
"Cascade Delete Detail Rows on Master Delete" is checked.
Error situation 1 (where the master just has one child row (number of detail rows to be displayed = 2)):
When trying master action=delete I get:
Error: No conversion performed for type INTEGER, value . (WWC-49102)
This happens whatever is chosen from the detail action drop down list during the attempted delete.
Error situation 2 (where the master has two child rows (number of detail rows to be displayed = 2)):
When trying master action=delete I get:
Error: An unexpected error occurred: ORA-02292: integrity constraint (MILLS_PORTAL.TEX_ACCOUNTS_FK) violated - child record found (WWV-16016)
This also happens whatever is chosen from the detail action drop down list.Sorry to say, but this is a bug which will get fixed in the forth coming releases.
Till then, there are 2 ways to avoid this problem:-
1> The change the foreign key in the detail table to have an ON DELETE CASCADE clause.
2> (Though not desirable, but still as a workaround)- Drop the foreign key constraint from the detail table. -
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 -
I have an application where I need to have master detail relationship. I have seen a demo ( dept-emp ) but my requirements are slightly different from this demo.
Just to simplify it, I have these fields in the SD_SOWS which acts as MASTER table and it has SOW ID as primary key.
And I have 2 detail tables. One is used to hold all the handsets (SD_SOW_HANDSETS ) and the other one is to hold all the platforms ( SD_SOW_PLATFORMS ) . And they both are tied up using SOW_ID column ( this is the fk ).
The problem arises when I added a new SOW and I have assigned SOW ID with the new value automatically by changing SOURCE to SQL Query and run this statement below :
SELECT NVL( NEXTVALUE ,1)
FROM (SELECT MAX(SOW_ID) + 1 NEXTVALUE
FROM SD_SOWS
But
1) when I added the one of detail tables ( SD_SOW_HANDSETS ) , this new SOW ID doesn't get carried forward to SOW ID column of this detail table (it becomes blank )
2) If I entered this column manually ( assuming I use the same number as the one in MASTER table -SD_SOWS ) and I have it saved , it throws exception
ORA-02291: integrity constraint (DSSMASTER.FK_SOW_HANDSET_SOWID) violated - parent key not found
I know the reason is that I haven't confirmed and saved the master table yet but I was wondering if HTMLDB can create a dummy SOW ID in the MASTER table and save it temporarily in db where it allows the children / details to reference the same number.
any ideas ?
DonyI'm always getting the same details for all masters rows. any idea what could it be ? Sounds like you didn't set the Block.Query Data Source Arguments property so that your Master block key values are not getting passed to your "Query" procedure. You will need to create a parameter to your procedure for the key value as well. Did you use my Demo or My Oracle Supports? If you used my demo, you will need to modify the EMP_SELECT procedure to accept the DEPT_NO as a parameter and then adjust your query to use the parameter.
If you used My Oracle Supports demo (doc ID 66887.1) then look at Example B. Multi-Block operations with Master-Detail relationship. It shows you how to write the query procedure to accept additional parameters.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Error trying to run a sample master-detail JSF form in Jdev 10.1.3
I've tried JDeveloper 10.1.3 folowing a tutorial , master-detail one , involving Adf Faces which I found it here http://www.oracle.com/technology/products/jdev/101/tutorials/e2ebcfaces/buildmaster-detailpagewithjdevandadfbc.htm.
1. I dowloaded JDeveloper 10.1.3
2. I made -in Jdeveloper- a connection to OE8 schema
2. I created an application with web application template ; in my new workspace i had 2 projects Model and ViewController
3. In model i choose Business Tier - ADF Bussiness Components - Business Components from Tables and I followed instructions in tutorial
4. In ViewController I created Web Tier - JSF - JSF JSP , with the JSF-JSP wizard a jsp page browseCustomerOrders.jsp. For building a master detail form i folowed instructions in tutorial
However ...
5. When I tried to run i received ....
" [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
**** Unable to obtain password from principals.xml. Using default.
D:\jdevstudio1013\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\config>
D:\jdevstudio1013\jdk\bin\javaw.exe -ojvm -classpath D:\jdevstudio1013\j2ee\home\oc4j.jar;D:\jdevstudio1013\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config D:\jdevstudio1013\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\config\server.xml
[waiting for the server to complete its initialization...]
05/11/30 12:04:16 Exception in thread "OC4J Launcher" oracle.classloader.util.AnnotatedNoClassDefFoundError:
Missing class: oracle.core.ojdl.logging.LoggingConfiguration
Dependent class: com.evermind.server.XMLApplicationServerConfig
Loader: oc4j:10.1.3
Code-Source: /D:/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar
Configuration: <code-source> in boot.xml in D:\jdevstudio1013\j2ee\home\oc4j.jar
The missing class is not available from any code-source or loader in the server.
05/11/30 12:04:16 at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2073) [D:/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@7]
at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1681) [D:/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@7]
at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1633) [D:/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@7]
at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1618) [D:/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@7]
at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap]
at com.evermind.server.XMLApplicationServerConfig.initJ2eeLogging (XMLApplicationServerConfig.java:243) [D:/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in boot.xml in D:\jdevstudio1013\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.XMLApplicationServerConfig.postInit (XMLApplicationServerConfig.java:255) [D:/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in boot.xml in D:\jdevstudio1013\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.xml.XMLConfig.init (XMLConfig.java:200) [D:/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in boot.xml in D:\jdevstudio1013\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.xml.XMLConfig.init (XMLConfig.java:117) [D:/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in boot.xml in D:\jdevstudio1013\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at com.evermind.server.ApplicationServerLauncher.run (ApplicationServerLauncher.java:74) [D:/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in boot.xml in D:\jdevstudio1013\j2ee\home\oc4j.jar), by oc4j:10.1.3]
at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap]
05/11/30 12:04:16 Fatal error: server exiting
Process exited with exit code 1. "
Where do you think i am wrong?
Many thanksHi,
the problem seems not to be within your application but in missing files on your embedded OC4J. Just try and unzip the JDeveloper 10.1.3 install again.
Frank -
Refresh of Master/Detail does not work after validation failure
After page validation stops further page processing of a Master Detail page, I get the following Oracle Error on display of the Detail portion :
<code>
ORA:01445: Cannot select ROWID from, or sample, a join view without a key preserved table.
ORA-06510 - PL/SQL unhandled user-defined exception.
</code>
Any clues as to why this might occur? The Master portion of the page displays fine along with the appropriate custom validation error message. It is just the detail portion (from a SQL based report) that is causing the problem. I do not use a ROWID either!
Thanks!Just an FYI for everybody who may have this very same problem in the future. I fixed the error and it had nothing to do with ROWID or views or anything like that. Under the Page Rendering section where you define the region definition under the source section, I had included the 'order by' clause in my SQL statement. This was the cause of my ORA-01445 error! When I removed the clause from the source definition and instead included it within the Report Attributes by checking the Sort box for the appropriate column (thus allowing APEX to generate the sort for me), the error disappeared! The Oracle error message would NEVER have given me a clue into what caused the error. I just happened to think 'what if I take the order by clause out'! How's that for a flukey fix!
-
Build JDEVADF_11.1.2.0.0_GENERIC_110531.1615.6017
Hello,
I have a Master Detail View. I show the objects of the views in a single table. I can filter the objects by Master View, but not of the detail view.
What should I do to the elements of detailed view can also filter?
<af:table value="#{bindings.MyView1.collectionModel}" var="row"
rows="#{bindings.MyView1.rangeSize}"
emptyText="#{bindings.MyView1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.MyView1.rangeSize}" rowBandingInterval="0"
filterModel="#{bindings.MyView1Query.queryDescriptor}"
queryListener="#{bindings.MyView1Query.processQuery}" filterVisible="true"
varStatus="vs" selectedRowKeys="#{bindings.MyView1.collectionModel.selectedRow}"
selectionListener="#{bindings.MyView1.collectionModel.makeCurrent}"
rowSelection="single" id="t1">
<af:column sortProperty="#{bindings.MyView1.hints.Ref.name}" filterable="true"
sortable="true" headerText="#{bindings.MyView1.hints.Ref.label}" id="c1">
<af:inputText value="#{row.bindings.Ref.inputValue}"
label="#{bindings.MyView1.hints.Ref.label}"
required="#{bindings.MyView1.hints.Ref.mandatory}"
columns="#{bindings.MyView1.hints.Ref.displayWidth}"
maximumLength="#{bindings.MyView1.hints.Ref.precision}"
shortDesc="#{bindings.MyView1.hints.Ref.tooltip}" id="it1">
<f:validator binding="#{row.bindings.Ref.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.MyView1.hints.Ref.format}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.MyView1.hints.Description.name}" filterable="true"
sortable="true" headerText="#{bindings.MyView1.hints.Description.label}"
id="c2">
<af:inputText value="#{row.bindings.Description.inputValue}"
label="#{bindings.MyView1.hints.Description.label}"
required="#{bindings.MyView1.hints.Description.mandatory}"
columns="#{bindings.MyView1.hints.Description.displayWidth}"
maximumLength="#{bindings.MyView1.hints.Description.precision}"
shortDesc="#{bindings.MyView1.hints.Description.tooltip}" id="it2">
<f:validator binding="#{row.bindings.Description.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.MyView1.hints.MYAddrView.FkProperty.name}"
filterable="true" sortable="true"
headerText="#{bindings.MyView1.hints.MYAddrView.FkProperty.label}"
id="c15">
<af:inputText value="#{row.MYAddrView.bindings.FkProperty.inputValue}"
label="#{bindings.MyView1.hints.MYAddrView.FkProperty.label}"
required="#{bindings.MyView1.hints.MYAddrView.FkProperty.mandatory}"
columns="#{bindings.MyView1.hints.MYAddrView.FkProperty.displayWidth}"
maximumLength="#{bindings.MyView1.hints.MYAddrView.FkProperty.precision}"
shortDesc="#{bindings.MyView1.hints.MYAddrView.FkProperty.tooltip}"
id="it15">
<f:validator binding="#{row.MYAddrView.bindings.FkProperty.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.MyView1.hints.MYAddrView.FkProperty.format}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.MyView1.hints.MYAddrView.AddrCity.name}"
filterable="true" sortable="true"
headerText="#{bindings.MyView1.hints.MYAddrView.AddrCity.label}" id="c16">
<af:inputText value="#{row.MYAddrView.bindings.AddrCity.inputValue}"
label="#{bindings.MyView1.hints.MYAddrView.AddrCity.label}"
required="#{bindings.MyView1.hints.MYAddrView.AddrCity.mandatory}"
columns="#{bindings.MyView1.hints.MYAddrView.AddrCity.displayWidth}"
maximumLength="#{bindings.MyView1.hints.MYAddrView.AddrCity.precision}"
shortDesc="#{bindings.MyView1.hints.MYAddrView.AddrCity.tooltip}"
id="it16">
<f:validator binding="#{row.MYAddrView.bindings.AddrCity.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.MyView1.hints.MYAddrView.AddrZip.name}"
filterable="true" sortable="true"
headerText="#{bindings.MyView1.hints.MYAddrView.AddrZip.label}" id="c17">
<af:inputText value="#{row.MYAddrView.bindings.AddrZip.inputValue}"
label="#{bindings.MyView1.hints.MYAddrView.AddrZip.label}"
required="#{bindings.MyView1.hints.MYAddrView.AddrZip.mandatory}"
columns="#{bindings.MyView1.hints.MYAddrView.AddrZip.displayWidth}"
maximumLength="#{bindings.MyView1.hints.MYAddrView.AddrZip.precision}"
shortDesc="#{bindings.MyView1.hints.MYAddrView.AddrZip.tooltip}"
id="it17">
<f:validator binding="#{row.MYAddrView.bindings.AddrZip.validator}"/>
</af:inputText>
</af:column>
</af:table>thank you
regardsHi Shay,
thank you for your reply.
I have two view objects based on two DB-tables. They are in relation with a View Link. So I have under my DataControls:
MyView1
-> MYADDRView.
I push my MyView1(Master) on the jsp and I select ADFTable. and I click to "Enable Sorting" and "Enable Filtering".
For the fields belonging to MyView1, I can filter the data, but when I want to filter a field belongs MYADDR, i have the error message:
ADF_FACES-60098:Faces-Gültigkeitsdauer empfängt nicht behandelte Exceptions in Phase INVOKE_APPLICATION 5
javax.el.ELException: java.lang.NullPointerException
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1579)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:158)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:483)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:157)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:279)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:145)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:479)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1129)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:353)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:204)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
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:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:121)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.NullPointerException
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._parseViewCriteriaItem(FacesCtrlSearchBinding.java:5268)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._parseViewCriteriaItems(FacesCtrlSearchBinding.java:5028)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4894)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:443)
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)
... 51 more
<RegistrationConfigurator> <handleError> ADF_FACES-60096:Server-Exception während PPR, #1
javax.el.ELException: java.lang.NullPointerException
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1579)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:158)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:483)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:157)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:279)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:145)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:479)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1129)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:353)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:204)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
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:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:121)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.NullPointerException
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._parseViewCriteriaItem(FacesCtrlSearchBinding.java:5268)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._parseViewCriteriaItems(FacesCtrlSearchBinding.java:5028)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4894)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:443)
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)
... 51 moreregards -
Requerying on Master Detail form
Hi,
Does anyone know how to set up PL/SQL code to automatically requery on a master detail form after insert/update? For example, if I insert a record on the master part of the form, I would like that record to automatically show up after the insert/update. Also, if I insert a record on the detail part of the form, I would like that record to automatically show up after an insert/update.
Thanks,
MartinHi Krishnamurthy,
Thank you very much for the code. The code for the most part acts like I want it to except when I initally insert a master record. In my case, I have the form set up so you have to insert a master record before you can insert any detail records. Therefore, after the user clicks save, that master record needs to come up. The code you gave me only brings up the current master record if you are inserting detail records (which is great, that is what I want it to do). I have modified the code you gave me so when a user is just inserting the master record, the master record automaticaly comes up rather than the first record in the table. However my code makes the form run slow (about 13 seconds to save). Do you know of another way that I can make the form act like I want it to. Below is my code.
Thanks again,
Martin
declare
l_msg varchar2(255);
l_key_value number(10);
l_key_value2 number(10);
v_get_id number(9);
v_check_detail number(9);
CURSOR GET_ID IS
SELECT MAX(A.PCH_ID)
FROM PORTAL30.PCHEADER A;
CURSOR CHECK_DETAILS IS
SELECT DISTINCT B.PCD_ID
FROM PORTAL30.PCDETAILS B WHERE B.PCD_PHC_ID = v_get_id;
begin
/*get the key field value from the Master Detail form to requery the details since the form will be cleared out after update */
l_key_value := p_session.get_value_as_NUMBER(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_index => 1
doSave;--- This is the default handler
OPEN get_id;
FETCH get_id into v_get_id;
CLOSE get_id;
OPEN check_details;
FETCH check_details into v_check_detail;
IF check_details%NOTFOUND
THEN
CLOSE check_details;
/*get the key field value from the Master Detail form to requery the details since the form will
be cleared out after update */
l_key_value2 := v_get_id;
/*get the message which is going to be displayed after update */
l_msg := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
/*now set the key field value in the Master Detail */
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_value => l_key_value2,
p_language => PORTAL30.wwctx_api.get_nls_language);
WWV_MASTER_GENSYS_1(p_block_name => null,
p_object_name => null,
p_instance => null,
p_event_type => null,
p_user_args => null,
p_session => p_session);
/*put the message(like 'Updated one master record' ) back in the screen */
p_session.set_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS',
p_value => l_msg);
p_session.set_value
(p_block_name => 'MASTER_BLOCK'
,p_attribute_name => '_MASTER_ACTION'
,p_value => 'NONE');
p_session.save_session();
ELSE
CLOSE check_details;
/*get the message which is going to be displayed after update*/
l_msg := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
/*now set the key field value in the Master Detail*/
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_value => l_key_value,
p_language => PORTAL30.wwctx_api.get_nls_language);
WWV_MASTER_GENSYS_1(p_block_name => null,
p_object_name => null,
p_instance => null,
p_event_type => null,
p_user_args => null,
p_session => p_session);
/*put the message(like 'Updated one master record' ) back in the screen*/
p_session.set_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS',
p_value => l_msg);
p_session.save_session();
END IF;
END; -
Delete on master detail does not work
I am trying to delete the master record from master table using the master-detail form. I am getting this error
An unexpected error occurred: ORA-02292: integrity constraint ('table_name') violated - child record found
ORA-02063: preceding line from 'Schema name' (WWV-16016).
I checked the 'Cascade delete detail rows on master detail' check box - Logically I would expect it to delete the detail and master record. Does this work? Is there anything that needs to be set in addition to this?
Thanks,
KarunaRepost
I'm sorry .it do work fine
Maybe you are looking for
-
I will install a second internal HD first, and use Time Machine Restore to it with the Migration Assistant on the new Mac's Mountain Lion. Then I will erase the preinstalled Mountain Lion internal HD, and: How do I now proceed to Restore to an intern
-
PDF Reader for IPAD 2: how to import PDF files in the library
I have installed the "PDF reader" app and it is a great one. but can't import pdf files that are already in my IPAD (I see them in iBooks)
-
Parameter Variable Handling in own Function Types
Hi experts, I've implemented a customer function type using a separate ABAP class. The function type has got several parameters that should be filled in a command that is defined on a WebTemplate button group. Planning functions that use this type ar
-
How do i know if the WRK54G rounter i have works?
I've followed the directions and all the lights light up but i get no IP address even when i reset the rounter and renewed the IP address, i know the modem works as i use it. I have a comcast dsl modem. I can not get to the set up page so does that m
-
Using a keyboard for Apple TV?
Can I use a keyboard - either a remote KB connected via BT. or one connecred via USB - instead of the remote supplied with AppleTV?