Last post May 06, 2005 05:13 PM by weiwei99
May 06, 2005 07:49 AM|weiwei99|LINK
When I use Data Access Application Block, I don't use it directly in each webform.
Instead, I put all the codes into a Class file:
Public Class MyDB
Public Function GetContact(ByVal UsrID as int32)
Public Sub UpdateContact(....)
Then in the webform, I will use some code like this:
Dim oMyDB as MyDB=new MyDB
For each database operation, I have to create this oMyDB object and later it will be destroy automatically by garbage collection.
Now my concern is that this extra object creation will slow down the performance if the application is used by many concurrent users.
I have considerd using static method of a class so that I don't have to create a object before calling the method.
But I don't know whether local variables of a static method will be shared by all the calling threads which obviously is not what I want.
Do you know the best practice in such situation?
May 06, 2005 05:13 PM|weiwei99|LINK
I asked the similar question 4 months ago.