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

Network optimization V4.50

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

    Network optimization V4.50

    We have installed an application on a network (3-user pack) and the shadow directory has been created in a worksation using network optimize command. From what I see this shadow directory includes "shadow" copies of each table, while the "real" table reside in the server. On the other hand, complete library files -operations, forms, Scripts and so on- exist in the workstation and can be edited locally without changing the libraries in the server.

    One apparent problem is that many saved operations -copy, summarize and maybe other- were specified to create tables in a default location, so when the operation is run from the workstation, the new table is saved where the database resides, that is the shadow directory. I can edit the saved operations in the workstation, setting the path of the table as "server _applicationdir_tablename", and the result table will be be saved in the server overwriting any previous file. This is Okay. But now the shadow database will include the new server table alongside the shadow copy. I guess I should Drop the server table from the shadow database and keep the shadow copy. Is this correct?

    Another issue is that the paths of many scripts were originally written as C:_ApplicationDir_tablename, (for example) and now I don't know if the shadow database recognizes the path to the server files. From my initial trials it appears that the scripts work well, performing all actions on the server files. Is this correct?

    I will appreciate all comments about these network issues. Thanks regards Antonio Wiesner

    #2
    RE: Network optimization V4.50

    Antonio

    I think you sould read a newsletter article about network optimization. There are many misconceptions about what actually is happening. The article was in issue 13

    One of the biggest issues concerns path issues. If you have defined fixed paths in a database, the terminal will not be able to find the path. The best way is to either keep eveything in the server database directory, or a relative path to the server database directory. If a path is not specifed in an Alpha operation, the program always assumes the database directory.

    For instance, you can create sub folders under the database directory. On the server, the result path would be a5.get_path()+ the sub directory path. On the terminal, this would give the same path back to the server - a5.get_master_path()+ sub directory path.

    Many users define their own function or code to determine if a script is running on the server or a shadow.

    if a5.get_master_path() = ""
    data_path = a5.get_path()
    else
    data_path = a5.get_master_path()
    end if

    If you use something like this, data_path will always point back to the database directory on the server.

    Jerry

    Comment


      #3
      RE: Network optimization V4.50

      Jerry, thanks for your assistance.

      Yes I read your article that explains very well what happens with network optimization. Our application works fine optimized, except for the saved operations that CREATE (or overwrite) tables: copy, summarize and crosstab. The problem is, the saved operation has a default path, inherited from the server database, and the new data will be stored at the terminal hard drive, which of course is not adequate.

      I found that if I edit the saved operation IN THE TERMINAL I can set the path for the result table as Server_ ServApliPath_resultable.dbf, and the physical table in the server will be created /overwritten, (not surprisingly). But now the server table will be included in the terminal database, together with the shadow version. If I DROP the server table at the terminal, the shadow version will still be correct with the server table data, so this would solve the problem.

      I wonder if dropping this resulting server table (unoptimized) from the terminal database is necessary at all. I fear that having two tables with the same name at the terminal, one from the server and one in the shadow directory, could create problems, so I would prefer to Drop the server table.
      I hope I was able to explain these issues, and I will appreciate your valuable comments

      Antonio

      Comment


        #4
        RE: Network optimization V4.50

        Antonio

        Have you tried removing all path information from the operations? This should create the new file on the server in the server database directory, since the operation should inherit that path.

        Jerry

        Comment


          #5
          RE: Network optimization V4.50

          Thanks, Jerry. The operations indeed had no path, only the default which is "resultable.dbf" only. Operations in the terminal will specify exactly the same, the local database default directory, and the result table will be stored in the shadow directory. The only way to create /overwrite the server table is that the operation specifies a network path to the server, which is entirely possible, and then the only problem is that the terminal database shows two versions of the same table, the server and the shadow.

          I have come to think that this duplication is really no problem, as the shadow table correctly addresses the hard server data. I am testing wether there is any confusion at the terminal between the "server" and "shadow" concerning Forms, other operations and so on.

          On the other hand, all scripts and the operations that do not create tables work fine. It is a pleasant surprise that a script line that specifies a hard drive path in the server works smoothly from the terminal, thanks to the Network Optimize development.
          I will appreciate further comments. Regards
          Antonio

          Comment


            #6
            RE: Network optimization V4.50

            Antonio

            If you have the shadow up to date, all forms, etc on the terminal are exactly the same as on the server. Since the shadow uses the local tables that are only pointers to the server, everything should work just fine.

            If you really want to write a table back to the server with an operation, you can convert saved operations to low level xbasic and then specify the path. I rarely use saved operations, but instead use xbasic since I can use variables in the code to specify filters, relative paths, etc.

            Jerry

            Comment


              #7
              RE: Network optimization V4.50

              Thanks again. It is a good idea to write XBasic operations and I will try it. Still I fear that the result table in the server will show up in the terminal database, let me try and I will let you know. This very useful chat we have had confirms my belief that the Alpha community is a wonderful user environment.
              Antonio

              Comment


                #8
                RE: Network optimization V4.50

                Antonio

                Here is a sample of code that will write a table back to the server

                ' These lines find the path for the data

                If a5.master_path() = ""
                Data_path = a5.get_path()
                Else
                Data_path = a5.get_master_path()
                End if

                ' these are the first 2 lines of actual subtract xbasic code
                ' This code will create an output file "hist_orphan.dbf" on the server

                subtract.t_db = "sale_det.dbf"
                subtract.o_file = data_path+"\hist_orphan.dbf"

                In many cases, tables created by joins, subtract, or copies are used just for reports or to create temporary tables that can then append data back to an existing table. It is a rare operation that has to create an actual table on the server. Usually the table already exists. You can always zap the existing table and then append the data from the temp file to the existing shadow table. That will send the data back to the "real" table on the server. In those cases, the output table is frequently deleted when the process is complete.

                Jerry

                Comment


                  #9
                  RE: Network optimization V4.50

                  Jerry, all your suggestions have worked really fine. I now have the data_path variable which I use in Xbasic operations both in the server and the terminal. Sometimes the operations from the terminal -copy, summarize- execute very slowly, and maybe the next time they run faster. Why would that be? In my code I have used the server addresses for all table paths such as in a summarize:

                  c_tbl = table.open(data_path+"_procompo.dbf")
                  sum.db = data_path+"_sulicompo.dbf"
                  sum.db_dd_delete = .F.
                  sum.order = "COMPONEN"
                  sum.filter = ""
                  sum.options = "I"
                  sum.fields = 3
                  sum.field1 = "Componen"
                  sum.code1 = 0
                  sum.field2 = "Tipo"
                  sum.code2 = 6
                  sum.field3 = "Campo1"
                  sum.code3 = 6
                  c_tbl.summarize()
                  c_tbl.close()

                  Should I use a default "procompo.dbf" file name in the first line, or keep the full path as above?

                  Another question: it appears that Xbasic crosstab operations form the terminal have some kind of problem, as they seem to stop at 98-99 percent records and restart, then run to the end with good results. Have you seen this type of problem?

                  Last question. "Refresh shadow" from the control panel at the terminal doesn't work and hangs Alpha Five.

                  Thaks in advance for your valuable comments

                  Comment


                    #10
                    RE: Network optimization V4.50

                    Antonio

                    Using table.open, you shouldn't need any path. The shadowed table will find the data on the server. Accessing the table directly from the server could slow down the process. The difference in speed could be to file locking issues if users have any of the tables open during the process.

                    I don't use crosstab, so I can't answer your question there.

                    Refresh shadow in versions 4.5 and older is somewhat unreliable. That was one of the many improvements in version 5. There have been a number of threads about how to work around the problem. I gave up on the built-in refresh and created my own. I think Cal Locklin posted some code in the archive that should help.

                    Jerry

                    Comment

                    Working...
                    X