Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Multi-User 100~300 new records per hour...locking error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multi-User 100~300 new records per hour...locking error

    I do understand record locking. But, what happens when 3~4 different workstations(desktop app) are adding both parent and child records to the same table using the same form at the same time in different locations?.....the same second? What if it were 20 workstations?

    I have 3~4 POS(Point of Sale)workstations, each with cashiers ringing customers at the same time. When we are busy we will ring 1,000 receipts with 3000 child records in 4 hours. When all 4 machines are going full blast...I have 8~10 locking errors per day.

    When a cashier rings an item say a 'coke' with the barcode gun, first the parent 'receipt' record is created immediately followed by the child record containing the details for 'coke'.

    Here is my question: Should it be possible to get an error message that the record is locked WHEN YOU ARE CREATING A NEW RECORD? How can a record that hasn't been created yet be locked? And if it is locked, how do you check to see if it is locked without a record number?

    if tbl.is_record_locked() = .t. then
    lbl_loop:
    if (tries < 8) then
    tries = tries +1
    sleep(1/10)
    if tbl.is_record_locked() = .f. then
    goto lbl_loopend
    end if
    goto lbl_loop
    end if
    ui_msg_box("Error","Livecount locked by another user, or in another session.",UI_STOP_SYMBOL)
    tbl.close()
    end
    end if
    lbl_loopend:
    This type of code can be used when posting to a record that 'may' be locked. however, what do I do when I'm creating a new record with child?

    #2
    Re: Multi-User 100~300 new records per hour...locking error

    Do you have referential integrity enabled? Sometimes you can get weird interactions between tables if you have referential integrity enabled.
    You also should make sure the opportunistic locking has been disabled on the server and on the client machines.

    Comment


      #3
      Re: Multi-User 100~300 new records per hour...locking error

      I have the home version of Windows XP. I don't think opportunistic record locking applies...(not sure)
      Secondly, I am NOT using any referencial integrity in my sets....

      Please help me find a solution to this....

      Comment


        #4
        Re: Multi-User 100~300 new records per hour...locking error

        Opportunistic record locking is the default in Windows XP. You should read this
        http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html
        for information on how to turn it off.
        I don't know if that will solve your problem. You also may have index locking issues. When you create a new record, any indexes are updated. Each workstation has to lock the index temporarily to update the index, and the more fields you have indexed, the longer it takes. If you have lots of indexes that you don't necessarily need all the time, I suggest you remove them. If you need them for daily or weekly tallies, create them when you need them and destroy them afterwards.
        The same applies to posting rules. If you have posting rules in your application then other tables are affected as well.

        Comment


          #5
          Re: Multi-User 100~300 new records per hour...locking error

          I wonder if this is a case where forcing the user to work in CHANGE mode would be advisable? If each new record began with a button push, the onPush event script could immediately and automatically save the record. The user then finishes editing the record in CHANGE mode, or DELETES the record if it should be abandoned. It seems to me that once the new record is commited there would be no additional index activity, and the only record that is locked is the one being edited... in this kind of app that's going to ok since you wouldn't have two stations entering an order for the same customer at the same time, right?

          Comment


            #6
            Re: Multi-User 100~300 new records per hour...locking error

            Good point,Tom. I only found that necessary with memo fields but then I'm not entering 300 records/hour into the same table(s).

            Comment


              #7
              Re: Multi-User 100~300 new records per hour...locking error

              Mark

              Are you doing some type of assigning values - Alpha's auto-increment or or a homegrown version - when creating a new record?

              Maybe the lock isn't the new record that you are adding, but another table/process that supports it.

              Also does this happen when a new parent is started or as child records are added? You mentioned that when a parent is added, a child is also added. When are the remaining child records added?
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: Multi-User 100~300 new records per hour...locking error

                When we are busy we will ring 1,000 receipts with 3000 child records in 4 hours.
                If you are not using SQL, you should.
                If you are attempting to do this with dbf, you are asking for trouble.

                If you are looking for a temp solution:
                1-Assign the parent's linking field's value to a variable
                2-Add the child records directly to the table via xbasic.

                Comment


                  #9
                  Re: Multi-User 100~300 new records per hour...locking error

                  Originally posted by Tom Cone Jr View Post
                  I wonder if this is a case where forcing the user to work in CHANGE mode would be advisable? If each new record began with a button push, the onPush event script could immediately and automatically save the record. The user then finishes editing the record in CHANGE mode, or DELETES the record if it should be abandoned. It seems to me that once the new record is commited there would be no additional index activity, and the only record that is locked is the one being edited... in this kind of app that's going to ok since you wouldn't have two stations entering an order for the same customer at the same time, right?
                  I did do this, it was suggested somewhere in the 'help' files. What you mean is to commit the record immediately after its creation. Then changing the record. The problem I had with this was that the child record sometimes would not appear. Later I discover that the child record was linked to Receipt number 1 instead of the newly created record.
                  topparent.new_record()
                  topparent.commit()
                  I realized that I had to pospone the topparent.commit() til after topparent:Browse1.new_record()
                  'and then i do the...
                  topparent.commit()

                  Comment


                    #10
                    Re: Multi-User 100~300 new records per hour...locking error

                    you didn't mention your network type - are you using a dedicated server with a server operating system, like server 2003? or are you using a shared windows network? do you have a dedicated server?

                    In my own humble opinion you should definitely have a dedicated server, with a server O/S (get server 2003) or linux(works really great as a file server with samba); you should upgrade the workstations to xp pro; and you should as per the article Peter mentioned, modify the registry on the server and workstations (unless you use linux).

                    Although the system is using Version 5, I have a client where there are frequently 6 to 8 concurrent users entering and editing records in the same tables. On this system, I am doing what Tom suggested; I am creating the records with xbasic, and then they are always in an edit mode. We have no problems with that system, and as it is running on Server 2003 enterprise, we DO NOT have opportunistic record locking disabled anywhere. (They wouldn't let us even if we begged.)

                    On another client system, using V8 and server 2003, without disabling opportunistic record locking we have problems.

                    I would tend to the hardware and upgrades first, and then consider taking Tom's approach of always putting them in an edit mode.
                    Cole Custom Programming - Terrell, Texas
                    972 524 8714
                    [email protected]

                    ____________________
                    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                    Comment


                      #11
                      Re: Multi-User 100~300 new records per hour...locking error

                      Originally posted by mschoi View Post
                      I did do this, it was suggested somewhere in the 'help' files. What you mean is to commit the record immediately after its creation. Then changing the record. The problem I had with this was that the child record sometimes would not appear. Later I discover that the child record was linked to Receipt number 1 instead of the newly created record.

                      I realized that I had to pospone the topparent.commit() til after topparent:Browse1.new_record()
                      'and then i do the...
                      topparent.commit()
                      then rethink the set and/or set the receipt number when you create the new record.
                      Cole Custom Programming - Terrell, Texas
                      972 524 8714
                      [email protected]

                      ____________________
                      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                      Comment


                        #12
                        Re: Multi-User 100~300 new records per hour...locking error

                        Al, these are good question.
                        Originally posted by Al Buchholz View Post
                        Mark

                        Are you doing some type of assigning values - Alpha's auto-increment or or a homegrown version - when creating a new record?
                        I'm using the auto-increment index for for the parent and child table.
                        Maybe the lock isn't the new record that you are adding, but another table/process that supports it.
                        the lock may-be occuring because of the child record that immediately follows.

                        Also does this happen when a new parent is started or as child records are added? You mentioned that when a parent is added, a child is also added. When are the remaining child records added?
                        Each Receipt ends with a 'tally' where the customer pays. this sets a logical field 'Done' to .t.. If a 'coke is rung after that, a new receipt is created with a line-item 'coke'. then subsequent child records are added to the same receipt until its tallied again and 'done' is set to .t.. I never have problems with the subsequent line-itmes. It seems to be only the first one where a new parent and child record are created at the same time.

                        Comment


                          #13
                          Re: Multi-User 100~300 new records per hour...locking error

                          Originally posted by G Gabriel View Post
                          If you are not using SQL, you should.
                          If you are attempting to do this with dbf, you are asking for trouble.

                          If you are looking for a temp solution:
                          1-Assign the parent's linking field's value to a variable
                          2-Add the child records directly to the table via xbasic.
                          I did try this method before. Before I basically took the 'receipt number' in a variable would use it to append new child records using the 'append' operation converted to xbasic. However, when I do this I noticed that I had to refresh,resynch,the layout or browse for the new appended record to appear on the form.
                          Doesn't muliple machines refreshing and resynching cause delays also?
                          The same was true before with SQL. I had to 'refresh' to see the data i just enterred...causing delays.

                          Or am I doing something wrong?

                          Comment


                            #14
                            Re: Multi-User 100~300 new records per hour...locking error

                            Originally posted by martinwcole View Post
                            I would tend to the hardware and upgrades first, and then consider taking Tom's approach of always putting them in an edit mode.
                            By putting it in 'edit mode', do you mean to make the form 'modeless' from the beginning?
                            Or do you mean to use the
                            parentform.allow_change(.T.)
                            parentform.Change_Mode()
                            to put it in change mode immediately after
                            topparent.new_record()
                            topparent.commit()
                            topparent.change_mode()

                            Comment


                              #15
                              Re: Multi-User 100~300 new records per hour...locking error

                              Originally posted by martinwcole View Post
                              you didn't mention your network type - are you using a dedicated server with a server operating system, like server 2003? or are you using a shared windows network? do you have a dedicated server?
                              I dont exactly know what you mean.
                              I have a couple of PC's linked by local area network, all the PC's are running Windows XP home. Shadow dbs run on 4 PC's and 1 PC in my office is the server PC.

                              Comment

                              Working...
                              X