L
Lothar Behrens
Hi,
I have a class that uses a static lock object like this:
public class WSClientAgent
{
static object lockUpdateBunchOfData = "lock";
public object LockUpdateBunchOfData
{
get { return WSClientAgent.lockUpdateBunchOfData; }
set { WSClientAgent.lockUpdateBunchOfData = value; }
}
// ....
}
Internally I double checked that all thread relevant code uses a lock
statement. To ensure all stuff uses the correct locking, I have
exposed the static lock as an attribute.
But it seems that I still get errors that probably rooted to a missing
lock anywhere, or a pitfall with the above code.
Is there anything how I have solved my lock issues?
I am using a object relational mapper (database classes) that causing
any seldom problems. Some external code uses the exposed lock to also
synchronize the database access. That's why I have exposed it. Also I
haven't yet put all ORM related code inside the class that runs the
thread to avoid exposing.
It is merely impossible to do so as I would wrap an ORM
It is a bit wired, as it is too seldom
Thanks,
Lothar
I have a class that uses a static lock object like this:
public class WSClientAgent
{
static object lockUpdateBunchOfData = "lock";
public object LockUpdateBunchOfData
{
get { return WSClientAgent.lockUpdateBunchOfData; }
set { WSClientAgent.lockUpdateBunchOfData = value; }
}
// ....
}
Internally I double checked that all thread relevant code uses a lock
statement. To ensure all stuff uses the correct locking, I have
exposed the static lock as an attribute.
But it seems that I still get errors that probably rooted to a missing
lock anywhere, or a pitfall with the above code.
Is there anything how I have solved my lock issues?
I am using a object relational mapper (database classes) that causing
any seldom problems. Some external code uses the exposed lock to also
synchronize the database access. That's why I have exposed it. Also I
haven't yet put all ORM related code inside the class that runs the
thread to avoid exposing.
It is merely impossible to do so as I would wrap an ORM
It is a bit wired, as it is too seldom
Thanks,
Lothar