Joy Conner
15th March 2007, 16:57
I am having an intermitant problem and would appreciate some advise.

I am running QKEY, BaaN IVc4 using Informix level 2 drivers on a unix system. We have significant customizations to the order entry program and this is where I am encountering a problem.

During the OE program, in

main.table.io:
before write:
tdsls041.myfield = myvariable

before rewrite:
tdsls041.myfield = myvariable

after.update.db.commit:
In this section a call is made to a library which puts data into one of our custom tables. Two input parameters are tdsls041.orno, tdsls041.pono.
If not myvariable then
send message to user about this problem
else
dll.call(input.orno, input.pono)
endif
function.dll.call()
select tdsls041.*
from tdsls041
where tdsls041._index1 = {:input.orno, :input.pono}
selectdo
endselect
mytable.myfield = tdsls041.myfield <<<<< This is a mandatory field reference.
db.insert(mytable)
commit.transaction()

This is a simplification of the process but should serve to illustrate the problem. Sometimes, an error is reported in log.informix. The error states that the reference does not exist, so the new record is not inserted.:confused:

In the library, I'm expecting to be able to read the sales order line record and retrieve the content of some fields. What am I doing wrong?:confused:

shah_bs
15th March 2007, 18:29
If you look for matching error messages in log.bshell, they should tell you exactly which reference is missing, and maybe point in direction of a solution.

mark_h
15th March 2007, 19:16
I would move this:

mytable.myfield = tdsls041.myfield <<<<< This is a mandatory field reference.
db.insert(mytable)
commit.transaction()

Inside this select statement:

select tdsls041.*
from tdsls041
where tdsls041._index1 = {:input.orno, :input.pono}
selectdo
endselect

The reason I would do this is because something could be happening to where you are not finding a tdsls041 record which would cause your problem. And might not be related to the reference field. The question is - why would there not be a tdsls041 record? Could the session and the table be getting confused on the tdsls041 table items. You could eliminate this by just using an alias for the select in the dll. Can you duplicate the problem or is it just random?

Joy Conner
15th March 2007, 19:47
The error frequency is once a week and no I have not been able to replicate this.

Given the process, could it be possible that the disk write of the tdsls041 record is not complete when I call for a read of that record? Seems that way to me.

mark_h
15th March 2007, 20:12
I think it could be, but I can not think of a way to prove it out. I have had to use the suspend command on some sessions that wrote and read reports. This gave the report time to finish and close the files. In debug mode it always worked - but when not in debug the file might be empty.

I think you can try to trap the error - then maybe also retry the query, but I have not tried it for this type error.

Hitesh Shah
19th March 2007, 15:11
As after.updat.db.commit is called after successful commit on main table , the possibility of not being able to insert in disk looks remote , when function.dll.call is activated .

Have u explored following possibility .
1. input.orno / pono set to 0 in a peculiar condition . Suppose u already verified log.bshell or event viewer to check the values for reference error .
2. Informix driver / Informix itself may have some problem in ur porting set / informix version . Upgrading to latest porting set or latest informix version may help . Porting set release notes may be of some help .