Solved

Transactions

Posted on 1998-08-24
3
162 Views
Last Modified: 2010-04-04
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!!!
0
Comment
Question by:Cumhur
  • 2
3 Comments
 

Accepted Solution

by:
KirkGray earned 40 total points
ID: 1337635
Use a TUpdatesql component.  This allows you to write the sql inserts, updates and delete yourself.  the advantage of this is that you can then make the source table(s) readonly (preventing the tables from being locked when the user edits), and implement your own optimistic locking.  Let me know if you need more info.
0
 

Author Comment

by:Cumhur
ID: 1337636
What is Optimistic Locking ?
0
 

Expert Comment

by:KirkGray
ID: 1337637
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!

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question