Core Data lightweight migration error - objective-c

I have been trying to get the core data lightweight migration working. Ran into an very difficult issue.
I have setup up automatic lightweight migration exactly like the documents and other SO posts. And then I create a new version, select it as current, add a new field to some entity, and then ran.
Got error:
migration failed with error Error Domain=NSCocoaErrorDomain Code=134140 "The operation couldn’t be completed. (Cocoa error 134140.)" UserInfo=0xce08c10 {reason=Can't find or automatically infer mapping model for migration,
One more error:
NSUnderlyingError = "Error Domain=NSCocoaErrorDomain Code=134190 \"The operation couldn\U2019t be completed. (Cocoa error 134190.)\" UserInfo=0xcdf2d00 {reason=Each property must have a unique renaming identifier}";
I have googled for "Each property must have a unique renaming identifier" for a while and found no result at all.
From the meaning of this error message, the properties should have unique renaming identifier. I go back to my model setting and found that I did have some renaming identifier exactly same.
My question is I didn't really change the model name at all. I just add a new field. I thought renaming identifier will only be useful when trying to renaming something. Or maybe it's required no matter what. If that's the case, then why XCode doesn't give us any warning or error about it? shouldn't it be very obvious for XCode to see?
Any suggestion is welcome.

Answering to a post from the past, but you are not the only one who encountered this Can't find or automatically infer mapping model for migration problem.
So, I had the same problem, on a big project with 12 model versions, and only lightweight migrations. Just had 2 properties renamed, and everything was ok until today.
The only fix I found was to add a mapping model (New File => Core Data => Mapping Model ) to my project between my 2 last model versions.
I hope I won't have to add one for each new model update. Seems to be a migration bug in Core Data to me.
Hope this will help other people struggling with this error.
But happened on both iOS 8 / iOS 9 devices

I don't believe migration works on the simulator. I always have to delete the app from simulator and start over after making changes to the managed object model.
Test install on a device, which is already set up with the older version, to be sure your migration is successful.

Related

DQS failed to execute in the package SSIS 2012

I am new to used the SSIS! I'm trying to use the DQS within the package to apply the business role on a specific column in the source table i.e. Contact title. This column takes different job titles related to Sales people, matching the values on the domain to the existed data. I made a package to perform this, inserting data from the source into the staging, but an error is propagated on the DQS part whenever I run the package.
[SSIS.Pipeline] Error: DQS Cleansing through Insert failed validation
and returned error code 0x80131516.
I hope someone can help / guide me!
After researching and reading many sources, I have found the solution for this kind of problems. The solution is hidden behind the reason! I simply changed the driver from default and the package was good to go. Steps to solve the issue are the following for future reference:
Step 1: Navigate to Project -> [PROJECT_NAME] Properties.
Step 2: Navigate to “Debugging” option from left panel and from Right panel, change Run64BitRuntime value to false.

Unable to create account for installing Oracle Database

So I was looking for installing an Oracle 12c database on my Windows 8 laptop, so that I could learn much of SQL(after posting my last question).
I have downloaded all the needed zips. obviously while trying I got error:
[INS-30131] Initial setup required for the execution of installer validations failed.
Additional Information:
- Framework setup check failed on all the nodes
- Cause: Cause Of Problem Not Available
- Action: User Action Not Available
Summary of the failed nodes
hp
- Version of exectask could not be retrieved from any node
- Cause: Cause Of Problem Not Available
- Action: User Action Not Available
Well after looking into many posts on SO, I figured out that it needs some hidden User account (C$). I got steps for setting up such a account but unfortunately they are not working for me.
Following the path as: Control Panel>Administrative Tools> Computer Management>Shared.
As mentioned in steps across internet, there is no option for me to create a new account.
Apart from that, I have tried changing my Username and also I have tried using default Administrator account but nothing seems working.
I am pretty sure this is not new so somebody out there must have a solution to this issue. Pls advice...
This is the description of the error, I saw it, but was trying to find an idea how to fix it.
Anyway, I solved it by renaming the volume group and updating accordingly the fstab and the grub.conf.

Core Data: Database migration causes duplicates

Few customers reported than after the core data migration, their database entries result duplicated.
We opened the databases they sent us and indeed the entries are duplicated. We restore the backup and convert again the database, but we can't reproduce the issue in the office. Migration just works.
What could be the reason of this duplication? Is it related to the structure of the model, or something else?
It's a lightweight migration using model mappings. The core data databases are based on mysql.
thanks
After battling this for a while, the solution was pretty obvious for us. As it would only happen very occasionally so it was hard to find a repro (and even harder to find the reason!).
It seemed the app would sometimes crash mid-migration (for unknown reasons).
We are using deterministic file names for the destinationURL in -[NSMigrationManager migrateStoreFromURL:...] like appdata.sqlite-model_version_2.3. We weren't checking for the existence of the destination before migrating, and NSMigrationManager would copy directly into it regardless..so we'd get duplicates of every entity from the first (crashed) attempt, and singles of everything after that.
A few -[NSFileManager removeItemAtPath:error:] calls for the .sqlite, .sqlite-shm and .sqlite-wal before attempting migration to clean up any previous failed migration have solved the problem for us.

Could not load type 'System.Data.Entity.Core.Mapping.EntityContainerMapping'

When I debug the following code, I receive the message "System.TypeLoadException was caught" when I perform the Delete().
Using db As New ScholarshipEntities
db.ApplicationHistories.Where(Function(h) h.HistoryTypeId = 0).Delete()
db.SaveChanges()
End Using
I am using EF 6.1 in Visual Studio 2013. I also have the EntityFramework.Extended library installed.
I have no trouble querying results. I thought the bug might occur when the Where method has no results, but that is not the case. I also have no problem adding new models (.edmx), which was a problem some people with this exception had.
I just recently upgraded to EF 6.1 and installed the Extended library. This is my first time using one of the extended methods. I've un-installed and re-installed the nuget packages with no success.
IntelliTrace shows the following exceptions from the Delete() call (in order):
'EntityFramework.Reflection.DynamicProxy' does not contain a definition for 'InternalQuery'
Cannot implicitly convert type 'EntityFramework.Reflection.DynamicProxy' to 'System.Data.Entity.Core.Objects.ObjectQuery<Scholarship.ApplicationHistory>'
Could not load type 'System.Data.Entity.Core.Mapping.EntityContainerMapping'
I've added an issue on the Extended library's github.
Update
I've reinstalled EF and the EF.Extended library with no luck. I am able to use RemoveRange in its place. I am able to create a new project, install the packages, add a model mapped to the same database, and successfully use Delete. Obviously, the problem is in my current solution.
In my solution, I have an ASP.NET project and a regular library project. In the ASP project, a page's code behind calls a method in the library RemoveHistory. The library contains classes for the business logic and data access. Both classes implement interfaces. The actual Delete occurs in the data access class. My model also resides in this library project.
I may be able to create a completely new project and bring everything over, but that will take quite some time. Even if I did, I want to understand why it doesn't work in the first place, so that I don't have to repeat this process.
If you want to delete certain rows do it like that:
Using db As New ScholarshipEntities
db.ApplicationHistories.RemoveRange(db.ApplicationHistories.Where(Function(h) h.HistoryTypeId = 0))
db.SaveChanges()
End Using
If you want to remove single entity do it like that:
Using db As New ScholarshipEntities
db.ApplicationHistories.Remove(db.ApplicationHistories.Single(Function(h) h.HistoryTypeId = 0))
db.SaveChanges()
End Using
I "solved" the issue some time ago. I'll eventually go back to try and reproduce the problem to confirm my suspicions.
There were multiple versions of Entity Framework installed in the solution. This didn't appear to affect basic EF functionality, though I'm sure it did in some subtle, potentially buggy fashion.
Every time the solution was opened, NuGet would state that it couldn't complete uninstallation. Uninstalling and restoring via NuGet was unsuccessful, and the packages had to be deleted manually. Once completely removed, I installed the packages again. This resolved the issue.
I wish I could give a more technical answer, though the basic reason was forgetting to look closer at the packages folder and configuration.

Schema specified is not valid. Errors: 'System.Data.Spatial.DbGeography' which cannot be mapped to a primitive type

I'm doing Entity Framework (v6) db first. I get the following error when trying to access data from my datacontext.
The relationship 'Model.FK_Table1_Table2' was not loaded because the type 'Model.Table1' is not available.
The following information may be useful in resolving the previous error:
The property 'Location' on the type 'Model.Table1' has a property type of 'System.Data.Spatial.DbGeography' which cannot be mapped to a primitive type.
Any idea what is causing this error?
I don't know if this is your problem, but I had a similar error when I upgraded from EF5 to EF6. The spatial data types moved namespaces. This link has all the info:
http://msdn.microsoft.com/en-US/data/dn469466
Boiled down, you need to:
Install EF6
Update any namespace/using statements
Remove references to System.Data.Entity
(Probably) refresh your EF diagram.
Probably you need to see the solution on this url https://msdn.microsoft.com/en-US/data/dn469466
I have fixed same problem after updating some content of my code from mentioned url page there they have given solution for update to EF-5 to EF-6 after updating some of references on my context class. it is working fine.