Hello,
we are using OpenAccess ORM 2010.2.714.1
In our solution we have a Web Application and a Class Library (DAL) that we use to read the data stored in a SQL Server 2005 DB installed in another server. The OpenAccess features are enabled only for the DAL Class Library.
The objects treated in the application are very simple: they contain few basic fields as string, integer and date (for a total of 10), and three fields related to other objects (that contain two field each) already stored into their own table.
We seem to have problems regarding inserting and deleting about 15000 objects in a sql server table: the application takes more than 300 seconds to commit the insert operation (almost the same for deleting).
The VB code to perform the insert operation is like that:
Protected
Sub
AddNewEntityObjectList(Of T)(
ByRef
plstEntityObjects
As
IList(Of T))
Dim
lblnStatus
As
Boolean
=
True
Try
ClearLogStatus()
mobjObjectScope.Transaction.Begin()
ObjectScope.Add(plstEntityObjects)
Catch
ex
As
Exception
lblnStatus =
False
…
Finally
If
(lblnStatus)
Then
mobjObjectScope.Transaction.Commit()
Else
mobjObjectScope.Transaction.Rollback()
End
If
End
Try
End
Sub
The VB code to perform the delete operation is like that:
Public
Sub
DeleteBySessionId(Of T)(
ByRef
plstEntityObjects
As
IList(Of T))
Dim
lblnStatus
As
Boolean
=
True
Try
ClearLogStatus()
mobjObjectScope.Transaction.Begin()
ObjectScope.Remove(plstEntityObjects)
Catch
ex
As
Exception
lblnStatus =
False
…
Finally
If
(lblnStatus)
Then
mobjObjectScope.Transaction.Commit()
Else
mobjObjectScope.Transaction.Rollback()
End
If
End
Try
End
Sub
The commit instruction takes more time for both operations.
Perhaps, is there any mistakes that caused this slowdown in the set of the instruction used to perform the insert and delete operations?
Do you have any suggestions to improve the performance?
Thanks in advance for your reply.
Joseph