Developer forum

Forum » Development » Server error when saving paragraph

Server error when saving paragraph


Reply

Im having troulble with a fresh dynamic web installation (version 18.16.0.12) with an sql database (or Access). Its not possible to save a paragraph on a page.

 

As described on this thread:

http://developer.dynamicweb.dk/Forum-17061.aspx?action=ShowThread&ThreadID=1247

- I've downloaded the latest defaultemptydata set - and set the update to 100, 180, 0 and 280 ... but the bug is still there :)

 

What am I missing?

 

Server Error in '/' Application.

You cannot add or change a record because a related record is required in table 'Page'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: You cannot add or change a record because a related record is required in table 'Page'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80004005): You cannot add or change a record because a related record is required in table 'Page'.]
   System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +1343191
   System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +45
   System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) +2323
   System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping) +42
   System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) +176
   System.Data.Common.DbDataAdapter.Update(DataSet dataSet) +12
   Dynamicweb.DataManager.updateDataSet(DataSet objDataset) +32
   Dynamicweb.Modules.Common.DbHandler.UpdateDataSet(DataSet ds) +35
   Dynamicweb.Modules.Common.DbObject.Save() +203
   Dynamicweb.Content.Paragraph.Save() +12
   Dynamicweb.Admin.ParagraphEdit.SaveParagraph() +605
   Dynamicweb.Admin.ParagraphEdit.Page_Load(Object sender, EventArgs e) +409
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074


Replies

 
Reply

Temporary workaround:

I have had the same error and as a workaround you can disable the new UI that worked for me.

 
Reply

This has also had me confused badly:)

 

This is probably because of a performance optimization we made once waaaaay back to accomodate for updating websites with lots and lots of pages. Upon each page save the menu structure has to be reloaded from the database, and to avoid doing this too many times when an editor works on the site, we implemented a feature that does the update to the database when the user logs off Dynamicweb. So when you create a new page, it is not stamped in the database until you log off (try it and see if this is the case). Then when you create a paragraph, it will attempt to stamp it in the database immediately, and since there's a referential integrity rule between Page and Paragraph this exception will be shown.

 

To avoid it completely, go to "Control panel" -> "Users" and uncheck the field "Update on logout". We sugges doing so. Since this setting was introduced, many enhancements to the menu load (ASP -> .Net amongst otheres:)) have been made, so there's really no reason to use it anymore.

 
Reply

Disabling the new UI seems to be the only solution...

 

Could it be a bug in the database? I seems to me that there are a problem with the Foreign Key Relationships on the Paragraph-table (Paragraph_FK00).

 
Reply

Hehe... Actually I also received this exception today after I posted my reply when I was working on a custom solution. It seems to be a problem with the new UI as Kevin suggests and I also found his solution to be the only fix:)

 

You must be logged in to post in the forum