Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Automated DB activity via Service

We are trying to programatically do some DB manipulation as a nightly process via a procedure defined in the SystemMonitor setting in EServer.cfg

Long story short it would seem that the attach/detach we are doing on tables isnt liking being run via a service without any Presentation Layer (I am guessing it is the 'Database Update - Removing/Adding Tables' progress bar ).

Is there any way to run these from the OEngine service?

(Note: They run perfectly fine with no issue via TCL)

Comments

  • Are you attempting to attach the tables using UNC or mapped drives? If the latter, that might be your problem. Services typically do not have the same access to resources as a normal user.
  • Thats a fair point @DonBakke. I try to setup services via UNC for that very reason but I have other people doing that now and they arent always quite as thorough (and definately aren't mind-readers!).

    I shall investigate the scenario I was presented with....
  • edited August 2023
    I didnt take information at face value and did some testing n my own (as I probably should have done in the first place TBH)

    Firstly, It doesn't appear to be UNC or permissions. The drive the service runs from is local to the server . I also started the Service as the LogonAs Admin user.

    As it processes fine via TLC, I ended up putting in a 'processing' log. Basically write out a log every step along the way so I could see the last successful step when run via the service.

    It was NOT the Attach/Detach as originally claimed.

    It seems to be this line:
    Delete_Index(TableToClear, "", 1)

    Commenting this single line out out allows the rest of the procedure to proceed and reach the 'FINISH' log entry; including attach_table, detach_table, define_database, create_index, delete_row commands....

    I Quoted [Quote()] TableToClear as a lark and lo and behold I hit the finish line.
    Not sure why it works without via TCL and not as a Service, nor am I sure why it is the only command that 'complained' as none of the other did and are not Quoted either.
  • I haven't had a chance to confirm myself, but does Delete_Index display any progress GUI?
  • It didnt for me from TCL.
    Thats why there was an assumption it was a Attach/Detach of the tables. There is a GUI there.
  • Actually, now I am second guessing myself.

    I keep trapping a FS200 error when running the Delete_Index in the procedure as a service but no such issue when via running the procedure via TCL.

    I think more testing on my part is required.
Sign In or Register to comment.