4 Answers, 1 is accepted
0
Omar
Top achievements
Rank 1
answered on 28 Apr 2014, 05:28 AM
any help please??
0
Hello Omar,
Thank you for your interest in Telerik Data Access.
The result you need can be achieved if a transaction that locks a given row is started. With Telerik Data Access this can be done with a combination between the MakeDirty and FlushChanges methods. In the thread from this link, you can find detailed explanation and an example that demonstrates the implementation.
I hope this helps. If you need additional information, do not hesitate to get back to us.
Regards,
Doroteya
Telerik
Thank you for your interest in Telerik Data Access.
The result you need can be achieved if a transaction that locks a given row is started. With Telerik Data Access this can be done with a combination between the MakeDirty and FlushChanges methods. In the thread from this link, you can find detailed explanation and an example that demonstrates the implementation.
I hope this helps. If you need additional information, do not hesitate to get back to us.
Regards,
Doroteya
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
0
Omar
Top achievements
Rank 1
answered on 28 Apr 2014, 12:05 PM
thank you for your reply i am using old open access
i dont need to update in row i will select it
all thing i need
i want to prevent any body make select on the locked row
iam using this code but not working
then call this
i dont need to update in row i will select it
all thing i need
i want to prevent any body make select on the locked row
iam using this code but not working
public
void
LockRead(
object
target)
{
objScope.TransactionProperties.Concurrency = TransactionMode.PESSIMISTIC_EXPLICIT;
objScope.Transaction.Lock(target, LockMode.READ);
}
then call this
var ftpDataStoreToLock = dp.SelectEntity<FtpDataStore>().Where(s => s.FtpDataStoreID == 4 ).FirstOrDefault();
dp.LockRead(ftpDataStoreToLock);
0
Hi Omar,
There is no direct API that can exclusively lock a row on SELECT. Even if such a lock is obtained another SELECT can always succeed with a NOLOCK hint.
As suggested earlier you can execute a dummy update by marking the object dirty ( scope.MakeDIrty) and then calling scope.Transaction.Flush. This will get an exclusive lock on the row which will block other reads (with default isolation level. A 'read uncommitted' select will succeed).
Regards,
Ady
Telerik
There is no direct API that can exclusively lock a row on SELECT. Even if such a lock is obtained another SELECT can always succeed with a NOLOCK hint.
As suggested earlier you can execute a dummy update by marking the object dirty ( scope.MakeDIrty) and then calling scope.Transaction.Flush. This will get an exclusive lock on the row which will block other reads (with default isolation level. A 'read uncommitted' select will succeed).
Regards,
Ady
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.