We are working with a legacy MSSQL database and VB.NET. The following was determined by looking at the database directly after the page cycle finished. psuedo code:
This gets called one or more times. It always works the first time it is called. It also works every time that is not the last time it is called. The Prop# properties are not getting saved to the database the last time the above is called when it has been called at least once before. The object is always created if it was supposed to be. E.g.
AND
AND
At the end of the button OnClick subroutine, the user is sent to a success page using Response.Redirect(). My hunch is that the Prop1 value is not getting saved to the database because the transaction opened by DataObject at the beginning of the page request is never successfully closed/completed, and the values are getting written in other cases because there are a number of database read and write operations that would trigger database visits by DataObjects in other circumstances. Does anyone know how to force DataObjects to make a database visit (i.e. write pending changes) or have alternative ideas as to why the Prop values are not getting saved in this one case? |
Hello GigMastersTech,
The issue seems to be a bit weird. Are there any chance of a sample that reproduces the problem? It would help us a lot.
Thanks in advance.
Sure thing. Reproducing this issue outside of the whole system is taking a bit longer than I thought, but I think it is still a good exercise because I might encounter a solution or a root cause other than my suspect while doing this.
Thanks for the understanding. I wish you good luck and let the force be with you =)
I completely understand that not having a way to replicate a problem essentially means it is irreparable. Anyway, I have managed to replicate a failure to read from the database, but cannot yet replicate the failure to write. The example is here: http://www.mediafire.com/file/69mlyk6edfnnp0j/DO_test.zip Contents: {Global.asax, Web.Config, TestObjects.vb, zTestPage.aspx, zTestPage.aspx.vb}
Super is required. Enter 1 parent -> works. Enter multiple parents -> only first works. Everything is getting written to the database, including each parent's UPDATE; I'm working on getting this to break.
Thanks, I will check this shortly. Likely, right in the beginning of the next week.
Thank you very much. I forgot to include the test case database SQL before but have just updated the zip by adding TestCaseDB.sql to the above zip, same url to get at it.
Hello GigMastersTech,
I tried building the sample and but unfortunately, was stuck. Could you help me with that?
My e-mail is dmitri.maximov at dataobjects.net; skype: dmitri.maximov
Thanks in advance.
Apologies. I was unaware of the in-house DomainBuilder. I have an updated the example with the extra function in Global.asax and included files for a Visual Studio 2010 solution containing a class library project and a web site project: http://www.mediafire.com/file/61qbc3tb33aacco/DOtest.zip
Thanks for the updated solution. I made some changes to it and sent it back with some comments. Check the e-mail, please.