I can't find the log file! But anyway, let's deal with that later. The captured exception is as follows:
1. Exception at "Flush()"
Code:
Server Error in '/WarehouseWeb' Application.
--------------------------------------------------------------------------------
SQL update or deletion failed (row not found)
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: NHibernate.HibernateException: SQL update or deletion failed (row not found)
Source Error:
Line 804: 'STEP 2. Update
Line 805: sess.Update(zInv_before_update)
Line 806: sess.Flush()
Line 807:
Line 808: trx.Commit()
Source File: c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb Line: 806
Stack Trace:
[HibernateException: SQL update or deletion failed (row not found)]
NHibernate.Impl.NonBatchingBatcher.AddToBatch(Int32 expectedRowCount)
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Boolean[] includeProperty, Object oldVersion, Object obj, SqlString sqlUpdateString, ISessionImplementor session)
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Object oldVersion, Object obj, ISessionImplementor session)
NHibernate.Impl.ScheduledUpdate.Execute()
NHibernate.Impl.SessionImpl.ExecuteAll(ICollection coll) +100
NHibernate.Impl.SessionImpl.Execute() +83
[ADOException: could not synchronize database state with session]
NHibernate.Impl.SessionImpl.Execute() +223
NHibernate.Impl.SessionImpl.Flush() +23
warehouse.web.utilities.DataManager.UpdateInventoryMaster(zInventory zInv) in c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb:806
[ExApplicationException]
warehouse.web.utilities.DataManager.UpdateInventoryMaster(zInventory zInv) in c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb:827
warehouse.web.dataentry.InventoryMaster.btnUpload_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\WarehouseWeb\pages\desktop\dataentry_forms\InventoryMaster.aspx.vb:1052
[ExApplicationException]
warehouse.web.dataentry.InventoryMaster.btnUpload_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\WarehouseWeb\pages\desktop\dataentry_forms\InventoryMaster.aspx.vb:1086
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
**************************************************
2. IF I commented out "Flush()" - in which case, you get the same exception but it fails on "Commit()" statement instead.
Code:
Server Error in '/WarehouseWeb' Application.
--------------------------------------------------------------------------------
SQL update or deletion failed (row not found)
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: NHibernate.HibernateException: SQL update or deletion failed (row not found)
Source Error:
Line 806: 'sess.Flush()
Line 807:
Line 808: trx.Commit()
Line 809: Catch ex As SqlClient.SqlException
Line 810: If Not trx Is Nothing Then
Source File: c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb Line: 808
Stack Trace:
[HibernateException: SQL update or deletion failed (row not found)]
NHibernate.Impl.NonBatchingBatcher.AddToBatch(Int32 expectedRowCount)
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Boolean[] includeProperty, Object oldVersion, Object obj, SqlString sqlUpdateString, ISessionImplementor session)
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Object oldVersion, Object obj, ISessionImplementor session)
NHibernate.Impl.ScheduledUpdate.Execute()
NHibernate.Impl.SessionImpl.ExecuteAll(ICollection coll) +100
NHibernate.Impl.SessionImpl.Execute() +83
[ADOException: could not synchronize database state with session]
NHibernate.Impl.SessionImpl.Execute() +223
NHibernate.Impl.SessionImpl.Flush() +23
NHibernate.Transaction.Transaction.Commit() +101
warehouse.web.utilities.DataManager.UpdateInventoryMaster(zInventory zInv) in c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb:808
[ExApplicationException]
warehouse.web.utilities.DataManager.UpdateInventoryMaster(zInventory zInv) in c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb:827
warehouse.web.dataentry.InventoryMaster.btnUpload_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\WarehouseWeb\pages\desktop\dataentry_forms\InventoryMaster.aspx.vb:1052
[ExApplicationException]
warehouse.web.dataentry.InventoryMaster.btnUpload_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\WarehouseWeb\pages\desktop\dataentry_forms\InventoryMaster.aspx.vb:1086
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Hope you'd be able to see what I failed to ...