Link to home
Start Free TrialLog in
Avatar of Cumhur
Cumhur

asked on

Transactions

I am using SQL Server 6.5
I have a table Client and have another table managers
One client can have several managers
That's why I put the managers into another table
Now I want to achieve that When user post then let the two tables post. When user cancel the editing let the two tables
remain unchanged.
I have tried cached updates.But It locks the table and another user can't access
Is there any way to do that without locking any table
The most important thing is that making the user feel that
he or she is entering data to a single object from a single interface.
NOT : DBGrid is automatically update when you navigate on the grid!!!
ASKER CERTIFIED SOLUTION
Avatar of KirkGray
KirkGray

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cumhur
Cumhur

ASKER

What is Optimistic Locking ?
It's a way of posting an update/delete based on previous values of a record.  It prevents the  "Lost update" problem.

For example, say a customer record has had a field called FirstName changed by the user from "Fred" to "Fredric".  Update it using sql like so:

Update Customers set firstname = "Fredric" where firstname = "Fred"
and CustomerID = 1

When this gets run, it will not update the record if another user has changed the firstname  of this customer.  You can test if the update worked by using the rowsaffected returned by the query.  If it = 0 then tell the user that the update failed 'cause another user changed the field values "under" them.  

For more information, see the updatemode property of the TSQL component.

Let us know if you need more info!

Cheers!