Orchard 1.7.2 - could not insert: [Orchard.ContentManagement.Records.ContentItemRecord]

Topics: Core, General, Troubleshooting
Dec 10, 2013 at 7:36 PM
Edited Dec 10, 2013 at 7:39 PM
crosspost: http://stackoverflow.com/questions/20503686/sql-server-compact-timed-out-waiting-for-a-lock-orchard-cms

I'm currently retrofitting my project onto 1.7.2 from 1.6. I first got this error upon creating a specific Content Item:
could not insert: [Orchard.ContentManagement.Records.ContentItemRecord][SQL: INSERT INTO Orchard_Framework_ContentItemRecord (Data, ContentType_id) VALUES (?, ?)]

SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 2,Thread id = 16096,Process id = 10760,Table name = Orchard_Framework_ContentItemRecord,Conflict type = x lock (x blocks),Resource = PAG (idx): 1066 ]
Afterwhich, I couldn't create any Content Item at all and just kept on getting this:
null id in Orchard.ContentManagement.Records.ContentItemRecord entry (don't flush the Session after an exception occurs)
I'm still in the process of validating if this was caused by a specific Content Type that had custom parts and tables (1-n relationships), but as of now I'm seeing the problem even with plain Content Types that use the existing fields within Orchard (just text fields, really).

But in case anyone else has seen this and has some ideas, kindly share anything you have, it would be highly appreciated. Thanks!
Dec 12, 2013 at 3:29 AM
I have isolated the issue with SQL CE. I started using SQL Server and haven't encountered this major error since. But I still want this resolved, so just post any ideas please! Thanks
Developer
Dec 13, 2013 at 1:12 PM
I've seen this error before, and it had to do with something else entirely. I can't recall the exact details, but I attached the debugger and configured via the Exceptions menu to break when exceptions are thrown, which allowed me to find out the real issue. It was something in my own code, an incorrect migration, invalid model, or something like that. Perhaps if you can reproduce your issue, you can take the same approach to find out.