Solved

Transactions

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

762 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