NetTalk Central

Author Topic: FM3 problem  (Read 4622 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
FM3 problem
« on: February 18, 2012, 03:07:18 PM »
I posted something then deleted it but I still have a problem.

This is in respect of a multi user application.

I have set up a folder called DATA in the application folder in which all the user folders are located. That folder is derived from a LoginID. The DATA folder is independent of the web folder. See attached for folder structure.

When I run my app the upg.tps file is updated in the DATA folder. That is because FM3 runs BEFORE the login screen appears. Then when the user logs in an UPG.TPS file is added to the USER folder as I have set the path of upg.tps n the web handler embed point where I set the location of the files. The location is based on the login id.

The trouble is that when I update the files, the UPG.TPS file in the DATA folder is being updated and not the one in the USER folder and I am getting a message that the version number has not been updated.

How can I get FM3 to work for an individual user folder?

Thanks

John

[attachment deleted by admin]
« Last Edit: February 18, 2012, 03:16:13 PM by John Fligg »

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: FM3 problem
« Reply #1 on: February 18, 2012, 10:27:41 PM »
John, this FM3 question might be in the wrong forum. Try forums.capesoft.com or email support.

Cheers

Rob

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #2 on: February 19, 2012, 02:09:19 AM »
Well it is specific to NT6.

John

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: FM3 problem
« Reply #3 on: February 19, 2012, 02:45:25 AM »
Ah, webhandler should have given it away.

I would not create a upg file for each dataset (I assume you have one dictionary?). Rather try set the upg file to a one specific location using setupgpath and see if that helps.  Your and your logged in users' upg file will then always be the same for the dictionary. An Error 47 should then trigger an upgrade, except if you did forget to increment your file's version number in the dictionary.

Hope this helps.


Cheers


Rob


John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #4 on: February 19, 2012, 02:59:08 AM »
Thanks Rob - yes that is what i was doing. I had the upg.tps file in the DATA path. But I was getting error 47 despite having changed the version number.

The thing is, and maybe I am over thinking this, surely when FM3 first runs it upgrades the DATA\Upg.tps file (which it does). Then the user logs in and the data file is then in DATA\UserLoginID\......

So how does that user data file know it has been upgraded? Or does it use ds_SetUPGPath('Data') from the global embed in FM3 Init?

I am getting confused because the upg.tps file path is not the same as the path where the data files actually are.

Thanks

John


John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #5 on: February 19, 2012, 03:11:24 AM »
Sorry not workring. Got error 47 again. Here is exactly what I am doing.

The folder structure for the master data folder is:

webapp\data and I set the location of the upg.tps here. I have checked and it is the only one anywhere on the server. I checked the upg.tps file contents and the file version numbers match the dictionary.

The folder structure of the user data files is:

webapp\data\userid\.....

When the app runs I get error 47 on any file I attempt to open in the user data folder.

John

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: FM3 problem
« Reply #6 on: February 19, 2012, 04:37:44 AM »
Hi John

See the basic example attached. It is rough, but shows the concept and the upgrade works. login 1, password 1 and login 2, password 2 have two different employee files. Hope it helps.

Cheers

Rob


[attachment deleted by admin]

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #7 on: February 19, 2012, 04:55:54 AM »
Thanks Rob - I have not actually run it but I think you have missed the basic issue .....

Your example appears to have the 2 tps files in the SAME folder. My problem is that tps files are NOT in the same folder as the upg file.

Will check it out all the same in case I have missed something.

Thanks

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #8 on: February 19, 2012, 05:03:12 AM »
Yes see my original folder structure attached.

The upg file is in either the DATA or WEBAPP folder. I am currently just putting it in the root folder Webapp.

But the files it should be upgrading are below in DATA\farrierus in the example.

So when FM3 first runs it upgrades the files where it thinks they should be in webapp. But they are not there!! At this stage when FM3 runs the user has NOT logged in so it cannot possibly know where to find the files.

The tps files have the path attribute set in the web handler which is run AFTER login.

HTH

John

[attachment deleted by admin]

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: FM3 problem
« Reply #9 on: February 19, 2012, 06:27:15 AM »
I ignored the directories in my example, because they formed part of the file name in the design you have. I did modify the example I send you to confirm, and moved the employee1.tps file do webapp\1\employee1.tps and employee2.tps file do webapp\2\employee2.tps. the filenames were updated as well. The upg is still in webapp. An upgrade worked fine. So the concept and execution works.

Either you changed the file prefix? or I am starting to think that your upg file and dictionary changes have somewhere gone out of sync. So when FM tries to decide what to upgrade your files from, to the new structure in your dict, it can't find the matching current (old) file structure.

Cheers

Rob

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #10 on: February 19, 2012, 06:34:13 AM »
Sorry Rob, I misunderstood.

I think you are right about the out of sync part. I have not changed the prefixes, only the versions and added fields.

So how do you get everything in sync again?

Thanks

John

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: FM3 problem
« Reply #11 on: February 19, 2012, 07:05:06 AM »
Hi John

First price is if you have a upg file in a dataset which did upgrade correctly (you would have to be sure that is the correct upg file though) and copy this file into the dataset's upg path which is having a problem. This should work.

FM comes with a upgview tool in the 3rdparty/bin folder called upgview. This might help you look at the upg file to see what version history and file structures it knows off.....have a look the the changes report in this tool as well. It give a you version to version history of what has changed. This will help you with second price below....

1 - Undo the changes you made in the dictionary. If you have a backup of the program in non-error 47 state, restore that version. Alternatively, if you are aware of the changes you have made to the dictionary to cause the error 47, and it is easily undone, then do so.

If you are unsure of the structure of the current TPS file on disk, use TopScan to view the file structure.
E.g.: TopScan File > File Layout.

At this time, set the file versions in your dictionary, run your program and touch all the files (if you can start with no upg file). Then make the relevant changes in dictionary and they files should upgrade

2 - Manually create a conversion program. Using the before and after file structures, you can manually create a conversion program in Clarion to get the file structures correct. Then repeat the paragraph above.


Cheers


Rob

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: FM3 problem
« Reply #12 on: February 19, 2012, 07:11:21 AM »
Eeeek - this could apply to over 1000 data folders!

I was hoping to have just deleted the upg.tps file and somehow force it to regenerate.

Maybe it is my development folder that is the issue. If I download the "live" data and run that against my development code that may work then.

The live code is running against an older copy of the app and those files have NEVER been upgraded.

Thanks

John

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: FM3 problem
« Reply #13 on: February 19, 2012, 07:28:37 AM »
Sounds like 1000 data folders warrants some more digging on your part there..good luck.

Cheers

Rob