oracle devart entity framework - added New column - now trigger system_id not changing to a unique new number?

StackOverflow https://stackoverflow.com/questions/15636942

Frage

oracle 10.4 devart dotConnect - 6.50...

MVC2 project - web page

User fills out form, then controller gets new entity, fills it out. saves database System_id before saving = 0 (its an int/number - so no cannot be null) Several other tables linked, so they have their own System_id as well. When it gets saved to database, some trigger (there is a stored trigger for the table, which I only seam to understand as when system_id=null to be fired), a new Number is assigned for System_id.

This all worked fine. Then I came along, and needed some updates. Another field needed on this "main" table (I have earlier, added columns to another table, with out issue)

Added column to this "main" table (restrict_to_me) Now when it tries to save to database - it trys saving "system_id=0". Linked tables, also make records with system_id=0

In entity framework designer - i can see the field system_id ENTITY_KEY=true and StoredGeneratedPatern=Idenity

So I can not see what I have done to stop somthing from working with the entity framework, except updating the entity framework.

Any direction much appricated

thanks

War es hilfreich?

Lösung 2

This was an Entity Framework issue, one many have already had.

Not every time, but some times, when updating the model, StoredGenereatedPattern being droped in a section.

http://www.ladislavmrnka.com/2011/03/the-bug-in-storegeneratedpattern-fixed-in-vs-2010-sp1/

When looking at fixes, did not understand that BOTH SSDL and CSDL parts stored in same text. So look in upper part that it has StoredGenereated Pattern.

Andere Tipps

When you added the new field, did you drop the table and recreate it?

If you did that then you deleted the trigger at the same time. So when you recreate the table, you also need to recreate the trigger.

Try inserting data just using an SQL statement and see if the id is generated.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top