Page 1 of 1

Wrong UPDATE-Statement on unauthorized table prevents saving

Posted: Tue 02 Aug 2011 09:12
by cp_Robert2
Dear Devart Team,
we have a case where we get an exception 'ORA-01031: insufficient privileges' in the SaveChanges-Method on saving an object.

dbMonitor shows me that EntityFramework sends a statement (example recreated), which causes the exception:
UPDATE categories SET id = id WHERE concurrencytime = :p0

The column 'concurrencytime' has the property 'Concurrency Mode = Fixed' and is of the type DateTime.

I have got a main table (e.g. products) which has a reference to a foreign table (e.g. categories). In our case, the foreign table is part of a foreign scheme in Oracle where we have only grants to SELECT and not to UPDATE. This makes sense, because we don't want to change categories.

This statement has no practical effect, because the id will be updated to the value of the database which is already in the row. This error is not really relevant if I have grants to do everything, but in my case with restricted grants I can't go on.

We're using .NET 4.0 with Self-Tracking Entities and Devart dotConnect 6.30.165.

Can you please reproduce this case and provide a patch?

Posted: Wed 03 Aug 2011 13:00
by Shalex
By design, empty updates are used in the Table-per-Type inheritance when real update is for child entity but fake update is for parent entity (to invoke the update trigger).

If this is not the case in your scenario, please send us a small test project with a model and the DDL/DML script to reproduce the issue in our environment.

Posted: Thu 04 Aug 2011 06:20
by cp_Robert2
There is no inheritence in our case.

As a short-time solution we have achieved a GRANT to an UPDATE (on categories). I try to provide an example project to solve it for the long-time but it takes a little bit time.

Posted: Tue 09 Aug 2011 15:57
by Shalex
We have implemented the possibility to turn off generation of fake updates for parent entities:

Code: Select all

var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
config.DmlOptions.EmptyUpdates = false;
This functionality will be included to the next build of dotConnect for Oracle. We will post here when it is available for download.

Posted: Fri 12 Aug 2011 15:07
by Shalex
New build of dotConnect for Oracle 6.30.202 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ . For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=21724 .

This build includes the possibility to turn off generation of fake updates for parent entities.