M
Max2006
Hi,
In our ASP.NET application We use strongly typed datasets and TableAdapters.
Is it a good idea to use a static TableAdpater to share the static instance
among all sessions?
My business logic components are like this:
[DataObject]
public static class AccountBLL
{
private static ProfileTableAdapter m_ProfileTableAdapter = null;
private static ProfileTableAdapter AccountProfileTableAdapter
{
get
{
if (m_ProfileTableAdapter == null)
m_ProfileTableAdapter = new ProfileTableAdapter();
return m_ProfileTableAdapter;
}
}
[DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
public static AppDataSet.ProfileDataTable GetAllProfiles()
{
AppDataSet.ProfileDataTable dt;
dt = AccountProfileTableAdapter.GetData();
return dt;
}
}
All asp.net sessions within the web application are going to share a single
instance of ProfileTableAdapter because it is static. I am a bit concern in
high concurrent situations. Is it thread safe?
Any help would be appreciated,
Max
In our ASP.NET application We use strongly typed datasets and TableAdapters.
Is it a good idea to use a static TableAdpater to share the static instance
among all sessions?
My business logic components are like this:
[DataObject]
public static class AccountBLL
{
private static ProfileTableAdapter m_ProfileTableAdapter = null;
private static ProfileTableAdapter AccountProfileTableAdapter
{
get
{
if (m_ProfileTableAdapter == null)
m_ProfileTableAdapter = new ProfileTableAdapter();
return m_ProfileTableAdapter;
}
}
[DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
public static AppDataSet.ProfileDataTable GetAllProfiles()
{
AppDataSet.ProfileDataTable dt;
dt = AccountProfileTableAdapter.GetData();
return dt;
}
}
All asp.net sessions within the web application are going to share a single
instance of ProfileTableAdapter because it is static. I am a bit concern in
high concurrent situations. Is it thread safe?
Any help would be appreciated,
Max