cancel
Showing results for 
Search instead for 
Did you mean: 

PowerBuilder 11.5.1 - Run("XXXXX.exe") on one machine, locks other stations on same environment

Former Member
0 Kudos

Hello again.....

When upgrading from PB9.0 to PB11.5.1 we encountered another issue:

when Running some application in code, such as:

Run("xxxxx.exe"),

everything used to work fine in PB9.0

After upgrade to 11.5.1,  what happens is this:

When the "Run" code-line is being peformed on one machine, the other stations on same environment, are "stuck", until the Run is over.

Can you shed any light on this ?

Thanks,

Ronit.


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Having just re-read you initial problem and the thread I think you need to look at what the exe you are calling is doing. It sounds as though you are waiting on a lock, perhaps a database locking issue?

Regards

David

Former Member
0 Kudos

Thanks, David,

but it's not a database locking issue.

Something with IO I guess or something else in the environment.

Former Member
0 Kudos

Can I just be clear, when one PC is waiting for the run command to write it's file to say "I'm done" to the user temp. The other PC's are waiting?

If so then what other than the database can be holding other PC applications?

If the exe being called is not acting on any DB or files then it cannot be that process that is holding up the others.

What are the others doing when they are being held up?

Is it possible that your PB application has some resources locked while it is waiting and that is causing the hold-up for everyone else?

You need to look at all the shared resources for IO & DB. One of these is your block.

Cheers

David

Former Member
0 Kudos

Hi David,

I will look it up.

I guess it might be an IO block, but I'm not sure any more.

We'll try to make some changes, build, deploy again and check......

Regards,

Ronit.


Former Member
0 Kudos

Just a thought, did you upgrade your Database at the same time. I wonder if the issue is that rather than the PB application.

You could (so long as you are not deliberately holding an open transaction) do a Rollback; just before the run command to clear any PB transactions?

Let me know how you get on.

Cheers

David

arnd_schmidt
Active Contributor
0 Kudos

No database issue?!

Wow! How did you proof that?

Former Member
0 Kudos

Because the exe runs an external program that has nothing to do with our DB.

Former Member
0 Kudos

My gut tells me that it's you PB application that is holding the other users not the called program. But without a code audit I cannot say any more.

Former Member
0 Kudos

No need to be cynical....... Arnd.


ricardojasso
Participant
0 Kudos

Ronit,

Could it be that the external program is a shared program in a file server? This might cause file locking issues.

I'd suggest commenting the Run line of code and uncommenting the Sleep(5) command to simulate your program running the external program and waiting for it to finish. If the other PCs are still getting stuck then the calling program must be using some DB (or other) resource needed by the other PCs before the external program is executed.

Ricardo

Former Member
0 Kudos

If you are interacting with the file solely to determine if the external program is finished, there is another way.

I have an example that shows the Windows API functions that can be used to do a Run And Wait instead of using the built in Run function.

Topwiz Software - RunandWait

Former Member
0 Kudos

Hi Ronit;

  There is nothing different about the RUN ( ) method in PB 9 vs PB 11. I have ported dozens of PB applications from PB 9 to PB 10/11/12 with no issues using this command.

  Are you sure that your PB 11.x applications are actually using the Run ( ) method vs another mechanism like the ShellExecute MS-Window API for example. In the latter case, moving to PB 11 being Unicode and PB 9 being ANSI - the SDK call would be different.

  BTW: What kind of EXE are you instantiating? Also, what flavour of MS-Windows are you using?

Regards ... Chris

Former Member
0 Kudos

Hello Chris

It's a real Run command:

Run("call_credit.exe")

The program being called  is a .NET application for encrypting credit cards.

We are using Windows 7 Enterprise, SP1


Former Member
0 Kudos

1) The Run ( ) command does not wait for the called EXE to complete. There is no change in this behaviour in PB 11.x vs 9.x.

2) If you are passing command line arguments to the EXE from PB 11 - remember that this execution string will be Unicode by default vs ANSI from PB9. maybe the command line arguments are the issue?

  Tip: have a look at the new ENCODING parameters on many of the PB commands like Blob(), String(), FileOpen(), etc.

3) I would be looking at the workstation lockout issue as one being related to the "call_credit.exe" vs PB. PB's Run() method would not have that kind of scope.

Former Member
0 Kudos

Thanks for your thorough answer.

I use the FileOpen method. Opening a file under the TEMP direcotry of the user.

Does any of the following lines seem "suspicious" ?

----------------------------------------------------------------------------------------------------------

this.GetContextService("Keyword", lcxk_base)
lcxk_base.getContextKeywords("TEMP", ls_temp)
ll_file_num = 0

li_loop = 0
li_ret = Run("call_credit.exe")

//Sleep(5)
IF (li_ret > 0) THEN
  // Until the file is found
  DO WHILE (ll_file_num <= 0 and li_loop < 50)
   ll_file_num = fileopen(ls_temp[1] +"\int_ot_kkl.txt")
   Sleep(4)
   li_loop ++
  LOOP

--------------------------------------------------------------------------------------------------------------

Former Member
0 Kudos

Hi Ronit;

  Have you tried this for the FileOpen ( ) parameters  ...

   ll_file_num = FileOpen (ls_temp[1] +"\int_ot_kkl.txt", LineMode!, Read!, Shared!) )

Regards ... Chris

Former Member
0 Kudos

I will....

Thanks.


Former Member
0 Kudos

For testing, you may also want to display the full path you're using from the TEMP var. It's possible the file isn't being created in a User temp directory, but is ending up in the shared temp. If that's the case, then the file will be locked so no other users can get to it.

Also, Roland's idea to use RunandWait will keep you from having to sleep the calling process while waiting for the sub-process to finish. This means your users keep moving as quickly as possible because there's never a situation where the sub-app finished at beginning of a sleep call, but calling app still has to wait the full N seconds of sleep before continuing.