takesoln Posted March 5, 2004 Posted March 5, 2004 when a particular record in the database is edited by a client then all other clients must be denied to access the particular record in edit mode.how to achieve this in a web application Quote
WebJumper Posted March 5, 2004 Posted March 5, 2004 sql server has some locking function, maybe they work for you, read the doku. other dbs i don't know! maybe to set a col named "locked" to true while editing... regards, Stefan Quote
Joe Mamma Posted March 5, 2004 Posted March 5, 2004 (edited) maybe to set a col named "locked" to true while editing... regards, Stefan Lookup transactions. . . joe mamma [edit]I've removed some of the more childish comments from this post. -Derek[/edit] Edited March 6, 2004 by Derek Stone Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
kahlua001 Posted March 5, 2004 Posted March 5, 2004 I dont think he means sql statements overlapping each other, rather if a row is being viewed/edited on the front end by a user, like a content management system. can you elaborate? Quote
Joe Mamma Posted March 5, 2004 Posted March 5, 2004 I dont think he means sql statements overlapping each other' date=' rather if a row is being viewed/edited on the front end by a user, like a content management system. can you elaborate?[/quote'] ack. . . I didnt keep in mind that the forum is ASP.NET. . . that being said, I dont recommend http for live data editing, http is stateless, transactions wont work. Lets look at two of existing models: Order processing (book shopping), Inventory allocation (ticket purchasing), Order processing does not really need immediate updating. Message queues are used to process these. Your order is inserted into a table and a message is sent to the inventory control and the order is filled when the message is processed at a later point. record locking isnt really necessary because the oder can be backed out and/or the order is associated with an individuals account and others cant edit it. The other model, ticket purchases does require some sort of locking - you dont want to sell a ticket that some one else is considering buying. If we look at how ticketmaster does this, they have a 'time to live' on the consideration. this is done by making an entry into a separate table as to what the item is, when the item was put into consideration. when the client decides to purchase, the considered item is moved to an order table and deleted from the consideration table. If the consideration is dropped, just delete it from the coinsideration table. Now you may be tempted to put a consideration timestamp on the inventory table, but I recommend highly against this. . . why? I will let you think about it. If you can't figure it out, shoot me a private message. now, you may be thinking 'we want to just edit data not reserve data' well it is the same thing, only allow the user to make changes to data he has 'checked out for consideration' and prevent others from editing 'checked out items' by adding a calculated field 'IsCheckedOut' to what ever datasets the concurrent users select. Now. . . keep in mind this requires a completely separate process to be running that will clean up 'orphaned' considerations. Now if you really need live data editing, I highly suggest not using HTTP. What is the topology of your application? are all users within an authenticated domain? Is your site within a 'trusted' domain for all your users? Do you have a certificate that you can use to sign code? Answers to these questions would lead me toward different solutions. joe mamma Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.