The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

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).

asked 15 Jul '10, 07:17

Volker%20Barth's gravatar image

Volker Barth
29.3k287438644
accept rate: 32%

edited 15 Jul '10, 12:48

Mark%20Culp's gravatar image

Mark Culp
22.3k9129262

Volker: I have added the product-suggestion tag to your question.

(15 Jul '10, 12:49) Mark Culp

@Mark: That's what I had planned to do based on the answer to come, too:)

(15 Jul '10, 14:31) Volker Barth

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?

permanent link

answered 15 Jul '10, 12:46

Mark%20Culp's gravatar image

Mark Culp
22.3k9129262
accept rate: 40%

edited 15 Jul '10, 12:53

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!

(15 Jul '10, 14:39) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×404
×106
×22
×21
×20

question asked: 15 Jul '10, 07:17

question was seen: 1,031 times

last updated: 15 Jul '10, 12:53