Skip to Content
author's profile photo Former Member
Former Member

Locking Records using a field that is not part of the primary key

Morning,

I have created a lock object for a table and then called the ENQUEUE function module to lock records. Unfortunately I want to lock records based upon a field that is not included within the primary key of the table. As the field is not part of the primary key it is not one of the parameters for the function module.

The 2 solutions I can come up with are as follows:-

Solution 1

1. Read the records into an internal table.

2. Lock the corresponding records.

3. Read the records into another internal table and then compare the 2 internal tables.

Disadvantage of this solution

1. Have to perform an additional read and perform a internal table comparison.

2. I am reading before locking.

Solution 2

1. Include the field in the primary key of the table.

Disadvantage of this solution

1. The field should not be part of the primary key.

Any additional useful suggestions would be appreciated.

Regards

John.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 09:37 AM

    Hi!

    In Soulution 1, the 2.nd disagvantage can be eliminated, if you read the corresponding records one more after the locking. This means a double read for the same data, but some performance loss may cause a better and stable work for your module.

    Anyways, the 1st solution is much more "friendly" for me...

    Regards

    Tamá

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.