Home » Developer & Programmer » Forms » record no longer present after commit in form (forms 6i, Oracle 10g )
record no longer present after commit in form [message #447659] Wed, 17 March 2010 03:03 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello friends,

I'm working at debugging a strange situation. I have a form reading record information from a flat file and inserting data into a number of varied tables. At the end of file (last line read) the form issues a commit to make all inserts/updates permanent.
There is a record that disappears in particular and this everytime I re-run the test. I mean than in Debug mode, I find it in the right table everytime I query that table until the moment the commit is issued in the code - which is definitely the opposite of what should happen. I understand that for some reason a rollback happens for that record (others are ok after the commit) but my point is that if for some constraint reasons, the record did not qualify, an error should have popped up right from the Insert that added that record, right? Then How comes I find it in the table up until the moment of the commit ?? ...is the deferrable constraint property a clue for digging further?

regards,
Didier
Re: record no longer present after commit in form [message #447660 is a reply to message #447659] Wed, 17 March 2010 03:06 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Let "Exception" handler tell you where its getting into so called starnge situation.


Jak
Re: record no longer present after commit in form [message #447792 is a reply to message #447659] Wed, 17 March 2010 23:45 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello,

thanks for the suggestion. In fact I finally figured out what was wrong with the help of a colleague. You were not far from the solution though. In fact what caused the problem was a deferred referential integrity constraint. In the table with the 'ghost' record, there is a foreign composite key towards a master table. The problem is that part of the key is a char(5) field. In the program, when the value for this field is smaller than 5 characters, it does an rtrim on it before the insert. So somehow there comes a time when there is an inconsistency in the way the char(5) field is populated in the master and child tables...and when the program does a commit, well it causes an integrity constraint violation but it's too bad that in forms it's not explicit enough. The way it behaves is that it just rollsback giving you some obscur pls something error.

Anyway thanks a lot

regards,
Didier
Re: record no longer present after commit in form [message #447835 is a reply to message #447792] Thu, 18 March 2010 03:37 Go to previous message
Littlefoot
Messages: 20827
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why do you use CHAR datatype (and not VARCHAR2)? Is there any reason?
Previous Topic: error in cursor query
Next Topic: Maximising Forms window
Goto Forum:
  


Current Time: Thu Sep 29 15:50:09 CDT 2016

Total time taken to generate the page: 0.08993 seconds