Print Thread
Page 1 of 2 1 2
Record changed by another user error when editing record of indexed organized table
#51041 03/19/15 09:37 AM
Joined: Mar 2015
Posts: 8
F
Fredrik Offline OP
Member
OP Offline
Member
F
Joined: Mar 2015
Posts: 8
We are getting "Record changed by another user" errors when editing records on index organized tables.
It seems that this only happens on our non-unicode database and it only happens if the table is index-organized.

I have sent 3 emails to support with the same topic but no answers.
The emails has thorough explanations of how to reproduce the issue.

Last edited by Fredrik; 03/19/15 09:43 AM. Reason: Body of post got lost again
Re: Record changed by another user error when editing record of indexed organized table
Fredrik #51042 03/19/15 09:57 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Could it be that the SQL statement for the dataset includes some operations that modify the column data? For example a field like this:

select trunc(order_date) as order_date, ...

In such a case the record-change-check will see a different value in the result set than in the database, and will raise the error.

This is of course unrelated to index-organized tables or unicode, but it would be the first thing to check.


Marco Kalter
Allround Automations
Re: Record changed by another user error when editing record of indexed organized table
Marco Kalter #51045 03/19/15 10:42 AM
Joined: Mar 2015
Posts: 8
F
Fredrik Offline OP
Member
OP Offline
Member
F
Joined: Mar 2015
Posts: 8
No its a select x.rowid, x.* from table, so that is not the reason for the issue

Please take a look at the project I sent by email

Re: Record changed by another user error when editing record of indexed organized table
Fredrik #51068 03/20/15 02:57 PM
Joined: Mar 2015
Posts: 8
F
Fredrik Offline OP
Member
OP Offline
Member
F
Joined: Mar 2015
Posts: 8
Still no response to my emails. Did you not get them?

Re: Record changed by another user error when editing record of indexed organized table
Fredrik #51123 03/24/15 11:41 AM
Joined: Jan 2004
Posts: 59
G
Member
Offline
Member
G
Joined: Jan 2004
Posts: 59
Based on table type and some setting the row can be moved during update (due to better performance) and at that case the rowid is changed. And modified by another user is reported....

Re: Record changed by another user error when editing record of indexed organized table
giga #51125 03/24/15 12:12 PM
Joined: Mar 2015
Posts: 8
F
Fredrik Offline OP
Member
OP Offline
Member
F
Joined: Mar 2015
Posts: 8
Thanks for trying to help but I don't think this has anything to do with the rowid. If anyone at allroundautomations would try the sample project I sent I guess they would see the problem pretty easy.

I have a table like this test-table:

CREATE TABLE TEST_PRICELISTCODES
(
PRICELISTID VARCHAR2(10 CHAR),
STDPRODUCTID VARCHAR2(20 CHAR),
ALLOWNONSTDSIZE NUMBER(1),

CONSTRAINT PK_TEST_PRICELISTCODES
PRIMARY KEY
(PRICELISTID, STDPRODUCTID)
ENABLE VALIDATE
)
ORGANIZATION INDEX
;

What happens is that in TOracleDataSet.RecordChanged FI.QueryValue(Q) returns a value for 'STDPRODUCTID' that has x charachters cut off at the end of the string. What is strange is that how many characters that is cut off is affected by the declared size of the field 'PRICELISTID' which is the field just "before" in the table.

All this is also explained even more thorough in the mentioned emails to allroundautomations.


Re: Record changed by another user error when editing record of indexed organized table
Fredrik #51206 04/07/15 06:59 AM
Joined: Mar 2015
Posts: 8
F
Fredrik Offline OP
Member
OP Offline
Member
F
Joined: Mar 2015
Posts: 8
Still no real response from allroundautomations either here or to my emails. I have been getting good support from you guys in the past.
I really dont like this silence...

Re: Record changed by another user error when editing record of indexed organized table
Fredrik #52232 10/07/15 11:49 AM
Joined: Jan 2010
Posts: 20
C
Member
Offline
Member
C
Joined: Jan 2010
Posts: 20
Friedric: giga is right: index organized tables are exactly one of the data structures that cause row movement when data is updated.

info you need to know to understand this:
1) the rowid string is not a "random" value: it is the exact phisical position of the record in the database: if the record is moved to another disk block, its rowid changes.
2) index organized tables store row values DIRECTLY in the same data structure used for the primary key index: that is the table data is phisically "sorted", depending on the primary key values: if you change the primary key values, the record must be moved to another position, so its rowid changes.

so: you are experiencing EXACTLY what you should expect to happen when you use index organized tables: you changhe the primary key and the record is moved, so it rowid changes.

this means that you must write your own code in the OnApplyRecord event in order to implement the sql update.

I have never worked with index organized tables but I think that setting the UniqueFields dataset property should solve your problem

as a side note (for DOA developers if they are still reading):
1) OracleDataset could avoid this problem if it was using the "returning rowid into :newrowid" clause also for Updates, not only for inserts

2) it would be nice, for the same reason, that the "NewRowid" parameter of the OnApplyRecord event was taken in consideration also for Action = 'U' and not only for Action = 'I'

for the point 2 I did already solve it by myself by adding this line in my copy of the sources:

inside "procedure TOracleDataSet.InternalInsertUpdate;"

if ApplyRecord(c, NewRowId) then
begin
if Inserting then SetRowId(b, PChar(NewRowId));
if Updating and (NewRowID<>'') then //<<<< add this line
SetRowId(b, PChar(NewRowId)); // <<<<<< add this line





Re: Record changed by another user error when editing record of indexed organized table
Carlo Sirna #52707 12/14/15 11:54 AM
Joined: Mar 2015
Posts: 8
F
Fredrik Offline OP
Member
OP Offline
Member
F
Joined: Mar 2015
Posts: 8
Thanks Carlo Sirna for trying to help and sorry for not responding back sooner. I never got any notifications of a new answer to my post.

Sadly your reply is based on a wrong assumption that I am changing the primary key, which I am not(!).
In the test table i mentioned, I get the error when changing the value of ALLOWNONSTDSIZE. This is clearly a bug.
If allroundautomations would bother reading my email with a test project they would probably see right away.

If anyone will try this then create the table as mentioned earlier on a non-unicode database (on unicode database it works).
Then insert this test data:
Insert into TEST_PRICELISTCODES
(PRICELISTID, STDPRODUCTID, ALLOWNONSTDSIZE)
Values
('NY15', 'TS', 1);
Insert into TEST_PRICELISTCODES
(PRICELISTID, STDPRODUCTID, ALLOWNONSTDSIZE)
Values
('NY15', 'DIDCHRISTOPHERSP5KT', 1);

Create a test application that loads this data and try to change the value of the column ALLOWNONSTDSIZE. On the row with the value 'TS' in the column STDPRODUCTID it works, but in the row with 'DIDCHRISTOPHERSP5KT' you get "Record changed by another user".

Last edited by Fredrik; 12/14/15 12:02 PM.
Re: Record changed by another user error when editing record of indexed organized table
Fredrik #53295 03/16/16 09:36 AM
Joined: Mar 2016
Posts: 1
I
Member
Offline
Member
I
Joined: Mar 2016
Posts: 1
Hi. SYN_SKL2MOL is IOT.
I enable debug mode on OracleDataSet.
When I change record ODS execute query:

select * from SYN_SKL2MOL where rowid = :doa__rowid
for update nowait
:DOA__ROWID = *BAGGZ6MQODAwMTAwMDAwMDAxMUVDNAd4

but rowid this record = *BAGGZ6MQODAwMTAwMDAwMDAxMUVDNAd4cgEBAQEB/g
DOA cuts the rowid.
rowid wrong and I get exception record locked by another user.

DOA Info
Direct Oracle Access 4.1.2.0
OracleHomeKey: SOFTWARE\ORACLE\KEY_OraClient11g_home1
OracleHomeDir: C:\oracle\product\11.2.0\client_1
Found: oci.dll
Using: C:\oracle\product\11.2.0\client_1\bin\oci.dll
OCI: version 11.1
Oracle Database 11g Release 11.2.0.2.0


Oracle Version
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.036s Queries: 15 (0.013s) Memory: 2.5630 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-05-04 02:57:08 UTC
Valid HTML 5 and Valid CSS