This is a migrated thread and some comments may be shown as answers.

Error: Change of Identity not supported where column is primary key - Oracle

1 Answer 302 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Om Saini
Top achievements
Rank 1
Om Saini asked on 17 Nov 2010, 02:23 AM
Hi,

I am using the 2010Q3 release for updating few records in oracle database for one of the applications. Table has a single column which is used as counter and defined as primary key. It doesn't use the sequence in oracle and is manually updated from the last value.

I am using the following code to update the value in the table but ORM returns me an error "Unsupported operation: Change of Identity not supported"

private DWModel _entities = new DWModel("DWConnection");
         
private long UpdateDocumentCounter()
{
    var counter = _entities.DOCUMENT_COUNTERs.First();
    counter.CURRENTID = counter.CURRENTID + 1;
    _entities.SaveChanges();
    return counter.CURRENTID;
}

The designer shows CURRENTID Identity property as true, and Identity mechanism as default. When I try to change it to any other value I get a runtime error ORA-00942: table or view does not exist Telerik.OpenAccess.RT.sql.SQLException

I can't change the behavior of the other application as its an external vendor app, so have to go with its design. 

Any help really appreciated.

Regards
Om

1 Answer, 1 is accepted

Sort by
0
Accepted
Zoran
Telerik team
answered on 19 Nov 2010, 05:32 PM
Hi Om Saini,

 As you said, the CURRENTID property is identity property for the table where you keep the counter of the id's. However if you would like to update that property, you have to set Identity=false for it as otherwise it can't be modified. You could have another property as identity of this class or just leave it without identity if CURRENTID is the only column in the table thus the only property of the class.

All the best,
Zoran
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Design Time (Visual Designer & Tools)
Asked by
Om Saini
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or