cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a property to get the process ID of an external environment?

VolkerBarth
Contributor
0 Kudos
2,799

When using an external procedure that uses one of the external environments that have an one-per-connection scope (i.e. C, Perl, PHP), is there a connection_property or option to get the process ID of the external process?

When running several of those connections simultaneously, that would make it easier to identify which connection uses which process (and to find out how quick an external environment is closed and the like).

If there's no such property, I would suggest to add one.

I'm using SA 12.0.0.2483 (GA).

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

There is currently no connection property that will give you the process ID of the external environment.

Note that a single database connection could be associated with multiple external environments. For example, if the a connection was using a combination of C and PHP or PHP and PERL or C and PERL or ... (you get the idea). If this were the case then there could be multiple external process IDs. This complicates the issue - If we were to create a property then we would need to be able to list multiple PIDs.

If you wanted to know the pid of the external process, you could determine this yourself by implementing a external procedure which used getpid() and include this in your external library. If you included such a routine in each external library that you used and uniquely named the routines - e.g. getpid_c(), getpid_php(), getpid_perl(), etc - then you could determine the pid of each external process that the connection was associated with. Perhaps this would be a good example to include in the packaged samples?

VolkerBarth
Contributor
0 Kudos

I would suggest a connection_extended_property('ExternEnvPID', <externenvname>), so I could specify which external environment I'm interested in (as long as I can only get one of a kind per connection, which is a correct assumption AFAIK). So I might call connection_extended_property('ExternEnvPID', 'C_ESQL32');. But your suggestion to implement that by an external function will suffice for my needs and is really simple to implement. Thanks!

Answers (0)