zoukankan      html  css  js  c++  java
  • EntityFramework ORA-00955 名称已由现有对象使用

    Oracle implementation of Entity framework provider is very poor but there are some ways how to make this working.

    1. Simple but annoying - using NULL or own database initializer implementation:

      Database.SetInitializer<DatabaseContext>(null);
      

    or

    class DatabaseInitializer : IDatabaseInitializer<DatabaseContext>
    {
        public void InitializeDatabase(DatabaseContext context)
        {
            // your implementation
        }
    }
    
    Database.SetInitializer(new DatabaseInitializer());
    

    Set the initialized before first access to your database.

    1. If you want to use migrations create your views and then add migration with ignoring changes, for instance using package console add-migration initial -ignorechanges. This will make EF ignoring the inconsistencies between the DB schema and model (because it checks only tables from ALL_TABLES, not views) so it will not try to create table. There is a bug in Oracle EF implementation that if the initial migration is empty it drops and recreates the __MigrationHistory table so either your initial migration must containt at least one table before you add the view migration or you need to add a table afterwards.
  • 相关阅读:
    【转】进程与线程的一个简单解释
    折半查找
    BOJ 89 统计时间间隔
    BOJ 88 最值问题
    BOJ 87 日期
    QT杂记(网上资料整理而成)
    我的博客园
    【制作镜像】virsh
    【培训】MySQL
    ERROR 1045 (28000): Access denied for user 'root'@'localhost'
  • 原文地址:https://www.cnblogs.com/Farmer-D/p/8144414.html
Copyright © 2011-2022 走看看