T
TESA0_4
Hi,
I have built an application that is split into a backend and frontend to
create a multi-user environment.
I have a series of tables that are linked in a parent child relationship
that is five levels deep. The relationship is always one to one or one to
many. The business rules require users to be able to select a record at any
level in the 'data structure' and give that record a status of 'archived' and
optionally alllow the user to request a copy of the archived record to create
a new 'draft' version. An archiving/copying request applies to the user
selected record and all 'children', 'grandchildren' etc of the record in the
data stucture.
The users have trialled the application and said the archiving/copying
function complies with their business rules.
However, I did a 'test' where I opened a second level record in one frontend
session and began editing a field so that the record was locked. I then went
to another FE session, opened the parent record and initiated the
archive/copy code. Sure enough, the parent record was archived and then
processing failed with a locked record error when the code tried to archive
the second level record.
The nature of the business is such that there is a very low probability that
two users will be working on common set of records but it is possible.
What are the options for handling this situation?
Can I use my 'tree walking' code to pre-check all records that need to be
edited to see if any are locked and, if not, 'reserve' the record pending the
actual update of the records on the tables?
Is another strategy to make a temporary copy of the records to be edited and
restore records if the update fails?
Is there a means, via code, of temporarily removing record locking so that
the archiving update will 'always' be accepted? (From a business perspective,
an Archive/copy request will always have priority over any editing another
user may be doing to a record in the data structure.)
Thanks in anticipation of some smart ideas.
Tesa
I have built an application that is split into a backend and frontend to
create a multi-user environment.
I have a series of tables that are linked in a parent child relationship
that is five levels deep. The relationship is always one to one or one to
many. The business rules require users to be able to select a record at any
level in the 'data structure' and give that record a status of 'archived' and
optionally alllow the user to request a copy of the archived record to create
a new 'draft' version. An archiving/copying request applies to the user
selected record and all 'children', 'grandchildren' etc of the record in the
data stucture.
The users have trialled the application and said the archiving/copying
function complies with their business rules.
However, I did a 'test' where I opened a second level record in one frontend
session and began editing a field so that the record was locked. I then went
to another FE session, opened the parent record and initiated the
archive/copy code. Sure enough, the parent record was archived and then
processing failed with a locked record error when the code tried to archive
the second level record.
The nature of the business is such that there is a very low probability that
two users will be working on common set of records but it is possible.
What are the options for handling this situation?
Can I use my 'tree walking' code to pre-check all records that need to be
edited to see if any are locked and, if not, 'reserve' the record pending the
actual update of the records on the tables?
Is another strategy to make a temporary copy of the records to be edited and
restore records if the update fails?
Is there a means, via code, of temporarily removing record locking so that
the archiving update will 'always' be accepted? (From a business perspective,
an Archive/copy request will always have priority over any editing another
user may be doing to a record in the data structure.)
Thanks in anticipation of some smart ideas.
Tesa