ISTech Support Forum
http://www.istechforum.com/YaBB.pl
Evo-ERP and DBA Classic >> System Manager >> Disable logins
http://www.istechforum.com/YaBB.pl?num=1216120002

Message started by RPCAdmin on 07/15/08 at 04:06:42

Title: Disable logins
Post by RPCAdmin on 07/15/08 at 04:06:42

When disabling logins from the Admin menu, I constantly get the following error:

Attempt to lock DBA Classic Failed.  Please manually get users out of DBA Classic.
I know for a fact there are no users logged in at all.  Could there be an old Classic file floating out there that is giving me this error?

Title: Re: Disable logins
Post by NovaZyg on 07/15/08 at 07:08:45

the Disable logins code:

 DisableLogin.Click:
    openv 'bkpsuser' ext 'b' fnum bkpsuser_hndl lock R
    if file_exists(dpath()+"TP5WDBA.EXE")
      dummy_l = RENF(dpath()+"TP5WDBA.EXE",dpath()+"TP5WDBA.ZZZ")

      define fileloc.h type I size 5
      openv "fileloc" fnum fileloc.h path dpath() lock N
      findv G fnum fileloc.h key loc_file_name val "BKSYUSER","B"
      if loc_file_name = "BKSYUSER" .a. loc_comp_code = "B"
        dummy_l = renf(trim(loc_location,"T")*"BKSYUSER.B",trim(loc_location,"T")*"BKSYUSER.X")
        if dummy_l = false
          msg "Attempt to lock DBA Classic Failed. Please manually get users out of DBA Classic."
        endif
      else
        msg "Missing system file BKSYUSER.B Cannot lock DBA Classic at this time."
      endif
      close @fileloc.h
    endif


So it would seem BKSYUSER.B is locked or marked read only for you.

hope that helps...

Title: Re: Disable logins
Post by RPCAdmin on 07/15/08 at 07:21:09

Thanks Allen,  I will look into it.

Title: Re: Disable logins
Post by kkmfg on 07/15/08 at 10:27:53

Slightly unrelated to what was originally asked...

The source code seems to show that TP5WDBA.EXE is renamed before the check which is failing. And on failure it is never renamed back to it's original name (that I can see.) I'm sure it gets set back in whatever routine reenables logins. It's a small thing but it's probably best to completely back out the operation if any part fails.

Title: Re: Disable logins
Post by NovaZyg on 07/15/08 at 11:02:28

it already does this, I just did not paste in all the code...

Title: Re: Disable logins
Post by kkmfg on 07/15/08 at 13:20:57

That makes sense. I'm just in the habit of reading source code and I thought "oh, I hope there is better error checking than that!" You can't fault me for thinking that there may not be since you don't use transaction support at the DB level and we've more than once watched Evo blow it's load half way through an operation. Cleaning up half posted transactions sucks.

Title: Re: Disable logins
Post by RPCAdmin on 07/16/08 at 04:36:01

Update - well, BKPSUSER.B and BKSYUSER.B only exist in the \dbamfg\default directory.  Neither is read-only - if it is locked, I am not sure how to tell - although there is a file named BKSYUSER.X (is this the lock? - should I just delete the .X file?)

On a separate subject also - there are a lot of .run and .rwn files in the \dbamfg directory.  Does the new directory structure (where all or most of the .run and .rwn files are in the \dbamfg\default directory mean that these files in the \dbamfg directory are extraneous and can be deleted?  There are also a lot of .b database files in the \dbamfg directory - what about them? (most of them are older, but there are one or two exceptions (WBTRVMEMO.B for instance is only the the \dbamfg directory - and ISDRILLM.B is in both, but the one in \dbamfg is newer).

Title: Re: Disable logins
Post by kkmfg on 07/16/08 at 05:03:19

The source code he posted indicates that BKSYUSER.B is renamed to BKSYUSER.X during the disabling of logins. The problem here is that one cannot rename a file to be named the exact same name as an existing file. If you have BOTH BKSYUSER.B and BKSYUSER.X then something messed up somewhere down the line and you can't disable logins anymore because the code he posted does not properly deal with the case that BKSYUSER.X might already exist. It's possible that code elsewhere does deal with it but it doesn't sound like it.

So, the short answer is, yes, you should delete the X file. The longer answer: You should get rid of the .X file but never delete anything until you are sure you are doing the right thing. So rename the file something like BKSYUSER.BAK and then try things again. If you can get into the system and you can disable logins then it's fixed and you could delete the file now called BKSYUSER.BAK

And, I thought that the .RUN and .RWN files were supposed to only be in /DBAMFG/. I don't know why they'd be in default.

BTW.... This thread illustrates two very good points:

1. With access to the source code I (as well as others) could more easily answer people's questions so that Allan and Lynn don't have to answer so many questions
2. Opening the source opens one to critique of the source as well... Which could be one reason that people often don't want to release their source. But many eyes make for shallow bugs (the open source motto!)


RPCAdmin wrote:
Update - well, BKPSUSER.B and BKSYUSER.B only exist in the \dbamfg\default directory.  Neither is read-only - if it is locked, I am not sure how to tell - although there is a file named BKSYUSER.X (is this the lock? - should I just delete the .X file?)

On a separate subject also - there are a lot of .run and .rwn files in the \dbamfg directory.  Does the new directory structure (where all or most of the .run and .rwn files are in the \dbamfg\default directory mean that these files in the \dbamfg directory are extraneous and can be deleted?  There are also a lot of .b database files in the \dbamfg directory - what about them? (most of them are older, but there are one or two exceptions (WBTRVMEMO.B for instance is only the the \dbamfg directory - and ISDRILLM.B is in both, but the one in \dbamfg is newer).


Title: Re: Disable logins
Post by RPCAdmin on 07/16/08 at 05:53:08

"And, I thought that the .RUN and .RWN files were supposed to only be in /DBAMFG/. I don't know why they'd be in default."

I'm not sure myself, although I can tell you that when I reindex the database files (.B) the ones in the default directory change their date to "today" and the database files in the default directory are the ones that get constantly updated.

Title: Re: Disable logins
Post by kkmfg on 07/16/08 at 06:05:42

Yeah, the .B files should largely be found in the dbamfg/default folder but all of the .RUN and .RWN files are stored in the main /dbamfg/ folder. At least, that's my understanding of how it should be. And it's how it is here.

Title: Re: Disable logins
Post by RPCAdmin on 07/16/08 at 06:27:51

Yeah, OK - Never mind - Brain fart ...........There are no .RUN or .RWN files in the default directory.  There are however, some .B files in the \dbamfg directory, but not enough to be a space concern.  Too many things on the plate at once   :-[

Title: Re: Disable logins
Post by cathyh on 07/16/08 at 07:53:37

Lynn has a very good post on how to clean up the DBA folder and in it she says which .B files should be in the main DBA folder and which ones should only be in the Default folder.  
 
Here is the link: http://www.istechforum.com/YaBB.pl?num=1208451458

ISTech Support Forum » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.