Solved

Transactions

Posted on 1998-08-24
3
159 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now