Solved

Transactions

Posted on 1998-08-24
3
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 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