This question is locked. New answers and comments are not allowed.
Hello,
I'm still getting used to OpenAccess and have run into a problem. I'm sure it has to do with the way i'm implementing things. Here it goes. I have an ASP.NET website using OpenAccess. We have a screen where the user can edit a persistent object. Now if they click "Save" an error happens which we handle and log, the problem I think is that the commit never gets called. Now the user goes back to that screen and attempts to edit the persistent object again. When they click Save the following error happens. "Transaction already active". Any ideas on where i'm messing this up?
Thank you
I'm still getting used to OpenAccess and have run into a problem. I'm sure it has to do with the way i'm implementing things. Here it goes. I have an ASP.NET website using OpenAccess. We have a screen where the user can edit a persistent object. Now if they click "Save" an error happens which we handle and log, the problem I think is that the commit never gets called. Now the user goes back to that screen and attempts to edit the persistent object again. When they click Save the following error happens. "Transaction already active". Any ideas on where i'm messing this up?
Thank you
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click
Try
' Open a transaction and throw an exception
Scope.Transaction.Begin()
Throw New Exception
Catch ex As Exception
' swallow the exception for testing purpose
End Try
Scope.Transaction.Begin() ' <-- This fails "Transaction already active"
Scope.Transaction.Commit()
End Sub