Home » Open Source » Programming Interfaces » SQL query returning wrong values (Oracle Database 10.2.0.5.0 under Windows 7 x86)
SQL query returning wrong values [message #669719] Wed, 09 May 2018 07:21 Go to previous message
rfog
Messages: 4
Registered: May 2018
Junior Member
Sometimes a SQL query return previous values, but only in CRecordSet. Let me explain.

We produce a kiosk that has a local oracle database connected to the running program via ODBC under Windows 7 x86. The database is only for the running program and no other connection exists.

As a sample, we have a query that returns this combination of files and columns:

ANZAHL WERT
---------- ----------
37 500
11 1000

Program runs and unpdate the DB changing ANZAHL to 0. Subsequent calls returns the right values:


ANZAHL WERT
---------- ----------
0 500
0 1000

Until not. It starts returning the right values. However, suddenly, it starts to return the previous values, and once it starts doing that, always returns them. However, the strange things come here: both SQL Developer and SQLPlus retuns the right ones.

Program restart (or PC restart). Starts returning righ values and suddenly, starts returning the previous ones. Sometimes starts from first moment to return the previous ones.

And more strange things: we drop the entire database. Create a new one with all values set to 0. And yes, suddenly, the query starts returning the previous values. And both SQL Developer and SQLPlus always return the right ones.

Our code is a fixup of MFC C++, plain C++, some C# code. Read access to Oracle is done via CRecordSet, and are the object that sometimes fails to return the right values.

The worst thing is once it starts happening in one machine, we cannot resolve it. Same software, same oracle, same our program version. Two identical machines side by side. One starts to fail, the other not. If we import the database from the one is working well, it still fails. We have replaced the entire program. Reinstall Oracle... still fails. I've traced our code to the internals of the CRecordSet and all seems ok.

It seems some kind of cache in Oracle who is getting the trouble... but my knowing of Oracle is near to zero.

Can please someone help me on this?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IST sysdate default is not working with Entity Framwork
Next Topic: alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges
Goto Forum:
  


Current Time: Fri Apr 26 22:42:11 CDT 2024