EF database first cascades delete despite cascade is restricted in db and edmx setting End1/2 OnDelete = "None"

We are developing with Visual Studio 2013, Entity Framework 5, Oracle DB 11 via ODP.NET managed driver.
The edmx is generated/updated from database (database first). We generate POCO object using standard T4.
We have 2 tables with a master-detail foreign key relation, one to many. The foreign key in database does _not_ allow cascade deletes, so when you delete master row via SQL, you get error " ... child record found ... ".
The problem now is:
In Entity Framework, when i delete a record from the master table, then EF also deletes all corresponding detail records from the detail table! The restriction of the foreign key in database is ignored.
In edmx diagram, the properies End1 OnDelete / End2 OnDelete are set to "None", so i expect that on delete of a master row, EF should throw an error if detail rows exists.
How can i disable the cascading of the delete?
Here is the FK definition in edmx:
        <Association Name="USR_USER_ROLES_ROLES_FK">
          <End Role="USR_ROLES" Type="Self.USR_ROLES" Multiplicity="1" />
          <End Role="USR_USER_ROLES" Type="Self.USR_USER_ROLES" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="USR_ROLES">
              <PropertyRef Name="GES" />
              <PropertyRef Name="PROJ" />
              <PropertyRef Name="ROLE_NAME" />
            </Principal>
            <Dependent Role="USR_USER_ROLES">
              <PropertyRef Name="GES" />
              <PropertyRef Name="PROJ" />
              <PropertyRef Name="ROLE_NAME" />
            </Dependent>
          </ReferentialConstraint>
        </Association> 
 The delete of master row is done by calling:
ivDbCtx.USR_Roles.Local.Remove(role); // ivDbCtx is the DbContext, USR_Roles is the collection, role is the POCO object to be deleted.
Thank you very much for your help!
Udo

Hello,
For issues regarding ODP.NET managed driver, I would suggest you posting to oracle entity framework forum:
https://community.oracle.com/communications
There are oracle entity framework expects who will help you better.
Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • HT201269 I have encrypted back up of my iphone on my laptop, forgotten the encryption key. want to delete the old backup, remove encryption option and resynch with my iPhone in none encrypted. Have deleted the old back up but can't get ride of the encrypt

    have an encrypted copy of my iPhone back up on my laptop. forgotten the access code. I have deleted the back up and want to remove the encryption option and resynch with my iphone none encrypted, what are my options other than removing iTune from my laptop and reloading it

    1) You asked "Does she need to reconnect to that itunes/computer and if so what do we need to do to remove this folder of pics from her ipod?" Yes, you have to connect the iPod to that computer and go to the Photos pane for the iPod in iTunes and uncheck sync photos and the click on synce/apply. In the future do not check sync photos.
    iOS and iPod: Syncing photos using iTunes
    2)
    Create a NEW account for using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Then on the iPod go to
    - Settings>Messages>Send and receive and sign out your ID and sign into hers. Make sure that only her ID email address is listed.
    - Settings>FaceTime sign out of your ID and sign into hers. Make sure that under You can be reached at only her ID email address is listed
    - Settings>iCloud and sign out and sign in with hers
    Contnue to use the commpn ID/account for Settings>iTunes and App stores.

  • Deleting a stored procedure from an EF 6.1 Database First C# solution

    I added a stored procedure to a EF 6.1.x Database First solution. Then I changed the stored procedure on SQL Server. Hoped that the changes would be updated in EF when I used Update Model from Database from the Designer. But they weren't. Tables update correctly
    when I change the table's schema within SQL Server. Function Imports and classes generated from a stored procedure don't seem to update if I update the stored procedure however.
    So I figured that I would delete the stored procedure from the model and then re-add it. But wait! I couldn't find a way to delete the stored procedure from the model! There's no object to delete from the design surface when the object is a stored procedure!.
    First I tried deleting the class from the Solution Explorer. Bad idea. An update from the design surface duplicated the class!.
    The only way I found that you could completely remove a stored procedure from a Database First EF solution is to open the model browser and delete any class reference from the model's ComplexTypes , FunctionImports and from model.Store's StoredProcedures.
    Seems like a lot of work.
    Isn't there an easier way? Is it this hard in Code First?
    Michael

    Hello,
    >>Isn't there an easier way? Is it this hard in Code First?
    Curently, it seems that there is not a easy enough to delete a store produce in database first approach.You could post a feedback about this issue to:
    http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions
    When using stote produce with code first approach, it is easy since we do not need to import these SPs to the model, for details, you could check this link:
    https://entityframework.codeplex.com/wikipage?title=Code%20First%20Insert/Update/Delete%20Stored%20Procedure%20Mapping
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Exchange 2007 Public Folder Database cannot be deleted

    We are in the process of decommissioning exchange 2007 server from 2007 <-> 2013 coexistence.
    All user MailboxDatabases have been sucsessfully removed, however PF Mailbox databases return an error. 
    “The public folder database 'Public Folder Database' cannot be deleted”
    Object is read only because it was created by a future version of Exchange: 0.10 (14.0.100.0). Current supported version is 0.1 (8.0.535.0).
    I am suspecting the presence for 2 OAB is the reason why we can’t delete Public folder database from 2007 server.
    Get-OfflineAddressBook on 2007 returns
    Name               
    Server             
    Versions           
    AddressLists
    Default Offline ... ex07                
    {Version4}         
    {\Default Global...
    Default Offline ... Offline Address ... {Version4}         
    {\Default Global...
    Get-OfflineAddressBook on 2013 returns
    Name                                   
    Versions                               
    AddressLists
    Default Offline Address Book           
    {Version4}                             
    {\Default Global Address List}
    Default Offline Address Book (Ex2012)  
    {Version4}                             
    {\Default Global Address List}
    Questions:
    How can I check if both exchange servers are still OAB generation servers?
    I am not sure if the previous service provider moved OAB,  can I potentially cause any problems by executing  
    Get-MailboxDatabase | Set-MailboxDatabase -OfflineAddressBook "\Default Offline Address Book (Ex2013)"
    Move-OfflineAddressBook -Identity "Default Offline Address Book" -Server EX13
      3. Is it safe to delete 2007 OAB ?
    Thanks

    Default and System public folders show up under PF Management Console, however their preview pane on the right says "There are no items to show in this view" for both of them.
    below is the output from Get-PublicFolderStatistics on ex07
    Name                                     ItemCount              
    LastAccessTime
    Marketing                                   479              
    1/4/2014 10:15:14 AM
    Default                                  0                
    3/16/2014 1:34:35 PM
    EX:/o=First Organization/ou=Exchange Adm 2                 3/13/2014 1:00:00 AM
    inistrative Group (FYDIBOHF23SPDLT)
    EX:/o=First Organization/ou=Exchange Adm 0                 3/13/2014 1:00:00 AM
    inistrative Group (FYDIBOHF23SPDLT)
    exchangeV1                               401              
    3/16/2014 1:34:35 PM
    globalevents                             0                
    3/16/2014 1:34:35 PM
    internal                                 0                
    3/16/2014 1:34:35 PM
    Sales                                     713              
    1/4/2014 10:15:15 AM
    microsoft                                0                
    3/16/2014 1:34:35 PM
    OAB Version 2                            0                 
    1/4/2014 4:09:49 AM
    OAB Version 3a                           0                 
    1/4/2014 4:09:49 AM
    OAB Version 4                            0                 
    1/4/2014 4:09:49 AM
    OWAScratchPad{8382AFC4-6D63-4804-AC49-7B 0                 3/16/2014 1:34:35 PM
    4FDA2A4514}
    schema-root                              0                
    3/16/2014 1:34:35 PM
    Accounting                                 953              
    1/4/2014 10:15:16 AM
    StoreEvents{8382AFC4-6D63-4804-AC49-7B4F 0                 3/16/2014 1:34:35 PM
    DA2A4514}
    /o=First Organization/cn=addrlists/cn=oa 0                 3/13/2014 1:00:00 AM
    bs/cn=Default Offline Address Book

  • Ok, I have deleted EVERYTHING off my 16gb ipad. Photos, music, apps. All I have are the standard apps. It says I have used 11gb and only have 1.6 left. When I first bought it I had up to 4 movies and lots of apps, no problems. What's going on please!?

    Ok, I have deleted EVERYTHING off my 16gb ipad. Photos, music, apps. All I have are the standard apps. It says I have used 11gb and only have 1.6 left. When I first bought it I had up to 4 movies and lots of apps, no problems. What's going on please!?

    How much space is used by your Other? You may be able to reduce.
    How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
    http://tinyurl.com/85w6xwn
    With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5/6, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
     Cheers, Tom

  • Trying to open old iPhoto library on osx 10.9.5 with iPhoto 9.5.1.  iPhoto says I must upgrade but upgrade eventually hangs.  Tried to rebuild/repair database but it always says you have to upgrade database first and eventually hangs

    Trying to open old iPhoto library on osx 10.9.5 with iPhoto 9.5.1.  iPhoto says I must upgrade but upgrade eventually hangs.  Tried to rebuild/repair database but it always says you have to upgrade database first and eventually hangs

    What version was the old library made with?
    What is the exact message? when it hangs does it crash or do you have to force quit?
    LN

  • How to delete archivelog with RMAN in the Primary and Standby database?

    Hello,
    I am working on Oracle 10gR2.
    My question is :
    How could I implement a automatized and secure way of:
    1) Delete archivelogs on my PRIMARY server only when these logs are successfully TRANSFERED to all my standby databases?
    2) Delete archivelogs on my STANDBY server only when these logs are sucessfully APPLIED to the database?
    Thanks a lot for your help!

    on 10G
    CONFIGURE ARCHIVELOG DELETION POLICY TO [CLEAR | NONE | APPLIED ON STANDBY];
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rman.htm#CHDBEICE
    Coskan Gundogar
    http://coskan.wordpress.com

  • Rollback in database adapter with delete polling strategy

    Hi All,
    We have designed a database adapter with "Delete the Rows That Were Read" after read strategy with auto-retry attempts as 5. In BPEL process, where we are receiving the DB records, we are throwing a rollback fault in case of any fault.
    Database adapter polling is being re-tried 5 times in case of faults but the data is being deleted from the tables after 5 retries. Is this is the expected behavior of DB adapter? Doesn't the rollback fault rollback the complete transaction and leave the failed data back in the tables?
    Can any one provide more information on this polling strategy after the number of auto-retries are completed?.
    Thanks.
    -Pavan

    You need to include your bpel process in the same DB adapter transaction
    Use the following properties in the bpel component to do this
    <property name="bpel.config.transaction" type="xs:string" many="false">requiresNew</property>
        <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string"
                  many="false">sync</property>
    Make sure the connection factory that you are using in the DB adapter is XA transaction enabled

  • HT1937 in general setting for itunes wifi sync some how i got two folder first one the one i want :apps,movie, music, and tones some how i got second one is photo only, when i plug in it's only sync on 2nd one and not first one, i tried delete ituns and d

    i had problem for my itunes wifi sync, in general setting itunes wifi sync, i got 2 folder name 1st one is one i want sync for app, movie,music and tones, somehow i got second one folder i dont want is photos only when plug into it only sync for photo the rest are gone on itunes screen and not sync, please help me how can i delete second one folder? i tried click on first one not moved and syns only sync on second one folder
    thanks. i did try delete itunes and download back but still there, i tried restore iphone to itunes a few months back but itunes screen still on new second folder not the first one
    mjphu
    [email protected]

    I own the movies and I want them to stay in my iTunes library basically forever.
    But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
    iTunes prefs > Store > Show iTunes in the Cloud purchases.
    This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
    Also see this , -> Download past purchases
    and techncially, you don't "own" the movie, You simply have a license to use it.
    Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
    Actually, no it does not tell you that.
    FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
    Suggestions here -> http://www.apple.com/feedback/

  • How to use icons (database, database backup, save, delete etc.) in Oracle f

    Hi Everyone,
    I am using Oracle forms 5.
    I want to use iconic buttons in Oracle forms 5 for database, database backup, save, delete etc.
    Example:
    Like Oracle Enterprise Manager, a GUI tool, we can see the different icons for different items (icon for database backup, database etc).
    How should I get these icons? How should I attach these icons to the buttons/Image item in Oracle Forms ?
    Should I give the file path of these icons in property palette of an item in Oracle forms?
    If yes, then which property of item, will I use in order to attach the icons?
    Please send the solution.
    If some one can also send the related icons, I will thankful to him.
    Regards
    Martin

    Hi FRANKS,
    Thanks for your useful information.
    WIth regards to attach icons to button/text item in Oracle forms,I am still facing problem.
    As you said, I created the parameter/variable UI_ICONS in Forms Home and gave the value pointing to the directory holding the .ico files.
    And then set the iconic property of the button and the icon's name without its extension.
    But it didn't work.Could ypu please let me know what is going wrong?
    I am thankful to you.
    Martin

  • Database performance degrade - delete operation

    Hi,
    I have a big database. One of the table contains 120 milion records and many tables (more than 50) has referential integrity to this table.
    Table structure
    Customer (Cust_ID, and other columns). Cust_ID is Primary Key. Other tables has referential integrity to Customer.Cust_ID.
    There are around 100 thousand records that have entry only in this (Customer) table. These records are identified and kept in a table Temp_cust(Cust_ID).
    I am running a PL/SQL which fetches a Cust_ID from Temp_cust and delete that record from Customer.
    It is observed that a delete command takes long time and the whole system performance degrades. Even a on-line service that inserts row into this table looks like almost in hand stage.
    The system is 24/7 and I have no option to disable any constraint.
    Can someone explain why such a simple operation degrades system performance. Please also suggest how to complete the operation without affecting performance of other operations.
    Regards
    Karim

    Hi antti.koskinen
    There is no on delete rule. All are simple
    referential integrity.
    Like REFERS CUSTOMER (Cust_ID).
    Regards,
    KarimCan you run the following snippet just to make sure (params are name and owner of the Customer table):
    select table_name, constraint_name, constraint_type, delete_rule
    from dba_constraints
    where r_constraint_name in
           select constraint_name
           from dba_constraints
           where owner = upper('&owner')
           and table_name = upper('&table_name')
           and constraint_type = 'P'
    /Also check the last time the table was rebuilt - deletes w/o rebuilds tend to raise the high water mark.

  • Poll Database Adapter Physicial Delete strategy

    Guys,
    The database adapter should delete the record from table only if the record was processed successfully in esb or BPEL. But as far as i tested it deletes the polled record regardless of success or fault.
    Is there any setting that I need to do to force delete only when a successful instance is created.

    DB Adapter should participate in transaction, so upon failure it should be rolled back.
    Can you make sure you aren't using any MCF properties, and also in your process you don't have any dehydration point (e.g. recv/on-msg)?
    Regards,
    Chintan

  • Metrics on database read/write/delete based on size of the table

    Hi,
    Though we have many performance measurement tools,sometimes it is difficult for developers to trace and measure each read, some reads which look fine in the development environment turn out to be show stoppers in quality environments.
    I am trying to find if we can give a rough estimate of ideal response time of an RFC based on the number of database fetches/writes in the RFC assuming that the loops and internal table reads etc are optimized.
    e.g.: if my RFC performs two reads and one insert.I would like to arrive at a figure e.g.: 200ms should be the ideal runtime of the RFC.
    I would like to base my calculations based on the following parameters:
    - Table Size
    - Key/Index used
    e.g.: For a FETCH operation
        Table Size | Key Used | Total Time 
         Upto 1 G  | Primary  | 100ms
         1 - 5  G  | Primary  | 200ms
    Similarly for insert and delete..
    I have the following questions for the forum in relation to the above:
    - Is the above approach good enough for arriving at a
      approximate metric on total response time of an RFC ?
    - Are there any other alternatives, apart from using the
      standard SAP tools ?
    - How are metrics decided for implementations with Java
      and  .NET frontends ?
    Thank you,
    Chaitanya

    Hi There
    Do you mean dba_segments table?
    My boss want to export 2 big tables and import to training environment, each table contains more than 2 million rows.
    I want to know how big(bytes, or megabytes) are those two tables on the hard drive, because we are going to run out of the space on the same server. I am not sure the diskspace can afford such big export or not, so if I can know how big are those 2 tables, and then I can decide what I can do for export. For example: I got 200MB left on my /home directory, that is the only place we can put export, those 2 tables could be bigger than 400MB even though I compress the export file.
    Hopefully this time it is clear.

  • How to delete the line between the last point and first point?

    How to delete the line between the last point and first point? 
    I want to draw a curve many times, from first point to the end point. and redraw from first point to the end point.But I hope update point by point. but between the end point and the first point,  there is a line. How to delete the line?
    the code is:
    CNiReal64Vector plotData(50);
    m_graph.ChartLength = 50;
    //m_graph.ClearData();
    for (int j = 0; j < 2; j++)
           for (int i=0; i<50; i++)
                   plotData[i] = ((double)rand()/(double)RAND_MAX)*6 + 4;
                   m_graph.GetPlots().Item("Plot-1").ChartXY(i, plotData[i]);
                   Sleep(100);
    Attachments:
    20150605142608.png ‏31 KB

    Hi Kumar,
    I think you can just delete it in the sales order directly, if you are using make-to-order scenario, then there will be special stock left for the sales order as the production has been goods receipt, you need to use MM transaction move the stock to unrestricted use stock. If you are using make-to-stock scenario, there should be no further problem. If you are using assembly order, please try to reject the sales order item to see if it could fullfill your requirement.
    Regards,
    Rachel

  • HT5622 When my daughter got her first iphone we set it up with my email address, she now has her own email & new iphone.  I want to use my email address for my icloud, can I delete the content  from the icloud account and continue to use my email?

    When my daughter got her first iphone we set it up with my email address, she now has her own email & new iphone.  I want to use my email address for my icloud, can I delete the content from the icloud account and continue to use my email?

    Yes, but be sure she is on a separate iCloud account with a separate ID before deleting anything.  Be sure there is nothing that you want to keep on your device too.  When you delete the data from iCloud it will be deleted from all devices signed into the account.  Then you can delete the data from the existing account by doing the following:
    To delete the contacts, go to iCloud.com from your computer, log into your iCloud account and open Contacts, click on All Contacts on the left, to the right click on any single contact to select it, click on the Actions (gear shaped) icon at the bottom left and choose Select All, then press the Delete key on your keyboard.
    For Calendars, open the calendar on icloud.com, click Edit on the bottom left, then tap the minus sign to the right of each calendar to delete it.
    For Notes, open notes on icloud.com, click on each note on the left, then click Delete at the top to delete it.
    For Reminders, open reminders on icloud.com, click on each reminder and press your Delete key to delete it.
    For Mail, open your mail on icloud.com, click each folder on the left (such as your inbox), click on a single message to the right, press Control-A on your keyboard to select them all, then press your Delete key.  Repeat this for each of your mail folders except Trash.  When finished, click on the actions (gear-shaped) icon on the bottom left and select Empty Trash.
    If you also want to delete your iCloud backups you can go to Settings>iCloud>Storage & Backup>Manage Storage on your device, tap the name of your device under Backups, then tap Delete Backup.

Maybe you are looking for

  • Photo Apps not working

    The Photo Apps  with my brand new iPAD2 is not working. 1 . I tried synching pictures using iTunes as explained in the IPAD pdf User Guide and always get the following message: "certain pictures were not copied to the iPAD because it is impossible to

  • Iphone crashes itunes

    After I updated my iphone 5s to ios 8.2, itunes 12.0.1.26 crashes when I attach the iphone to the PC (WIN7)

  • How to get a euro or pound sign

    hello guys, i wonder if there is a way to generate a euro or pound sign on a mac keybord. we do work a lot with currencies and that would come very handy. best regards chris

  • [5800] Importing messages after backup failed

    Before installing the new firmware on my 5800, I backupped everything by using the backup function in the filemanager. I also did a hard reset. I started importing all of the settings and files from my backup, and it looked like it all worked. But wh

  • Can't Open a MySQL Database

    After downloading, installing, and starting the Xampp copies of MySQL and Apache, I created and loaded a small database, which I can see in a browser using localhost. In Dreamweaver I created and saved a PHP page on which I want to display database i