In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
682 [In-Portal CMS] Database bug report always 2010-04-08 22:52 2010-04-08 22:53
Dmitry  
 
normal  
active 5.0.3-B2  
open  
 
none  
[urlhttp://groups.google.com/group/in-portal-dev/browse_thread/thread/5e8a9ca61c9267e6][/url]
0
0000682: Refactor "Item Open for Editing" mechanisms
When user clicks "Edit", then we are checking, that given record(-s) is not being edited by another user already and we are showing warning message to the user about that, so he can immediately cancel editing to prevent possible data loss.

Currently it's implemented by scanning all temporary tables in database and searching our record ID in them. In case, when there are several administrators adding/editing data all the time, then you will have a lot of temporary tables at the end.

Idea of refactoring is to create table, where all items, that are being edited (not added) right now are listed. So instead of database scan we will need only to execute select to that table. Of course we need to add more code to properly update data in that table, so it will be actual in any moment.

Also, I would make sure that TMP tables are properly deleted whenever Session is gone - should be done by an Agent (running Session Expiration or may be different one).

We actually could place SessionKey into that new table, so we delete records by SessionKey, when session got expired.
We have data loss prevention system, that consists of several parts (all
only in administrative console):

1. [on by default] Data from tables being edited not directly, but via
   temporary tables created for each user individually (when user clicks
   "Add"/"Edit" buttons). When user clicks "Save" button on editing form, then
   data is copied back from temporary table to original live table.
  
2. [off by default] When user clicks "Edit", then we are checking, that
   given record(-s) is not being edited by another user already and we are
   showing warning message to the user about that, so he can immediately cancel
   editing to prevent possible data loss

3. [on by default] when user clicks "Save" button on editing form we are
   locking table, so nobody else in that moment couldn't overwrite data user is
   saving right now

 
Original idea by Sergey.
Issue History
2010-04-08 22:53 Dmitry Additional Information Updated bug_revision_view_page.php?rev_id=426#r426
2010-04-08 22:52 Dmitry New Issue
2010-04-08 22:52 Dmitry Reference => [urlhttp://groups.google.com/group/in-portal-dev/browse_thread/thread/5e8a9ca61c9267e6][/url]

There are no notes attached to this issue.