Home » Developer & Programmer » Forms » sync master-detail at commit time (Forms 6i)
sync master-detail at commit time [message #377857] Thu, 25 December 2008 23:21 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Merry Christmas everyone,

I unfortunately have a question for you. I have set a master-detail relation between two blocks linked by a parent-child relation (database level) on the same canvas. I have implemented commit through a save method triggered via a button. I have noticed that I get 'parent key not found' problem when saving a new record.

Test Case:
I create a new record in the master block, navigate to the detail block to feed child records for this new record(in master block) but my 'save' fails.


Test conditions:
1] The child record get its parent key copied from the master record (automated by the relation)

2] I query a temporary ID for the new master record via a select nextval from the sequence used for managing primary keys for that master block.

Hypothesis:
I guess it fails for the child records because at save time, the master record has not yet been committed (though all should happen at the same time)

Is there some means of working around this issue.

regards,
Didz
Re: sync master-detail at commit time [message #379748 is a reply to message #377857] Wed, 07 January 2009 19:10 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: sync master-detail at commit time [message #379763 is a reply to message #379748] Wed, 07 January 2009 20:35 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello,

actually no but the only workaround I have been able to suggest my end-users is to create the record in the master block, do a save then navigate to the detail block to create child records. It works in this way.


regards,
Didier
Re: sync master-detail at commit time [message #380025 is a reply to message #379763] Thu, 08 January 2009 21:01 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Yes, using the default master-detail behaviour usually works.

David
Re: sync master-detail at commit time [message #382588 is a reply to message #380025] Fri, 23 January 2009 02:32 Go to previous message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello everyone,

I have just found the solution to the issue described above on
OTN(http://forums.oracle.com/forums/thread.jspa?threadID=415684). So whenever you have a master-detail relation binding two blocks and you intend to save new record sets with a single commit. Never forget to set the DML Returning Value property to 'Yes' on you master block. In this way, the commit affecting your detail records won't fire a parent key not found violation.


God bless Oracle

Didz Smile

[Updated on: Fri, 23 January 2009 02:36]

Report message to a moderator

Previous Topic: Remove the message box
Next Topic: Exporting the data to an excel sheet
Goto Forum:
  


Current Time: Sat Feb 15 02:24:23 CST 2025