Thanks Marco.

I did run this command in the eventListener (postConnect):  

oci_set_client_identifier($c, 'user-name');

but after executing sql with entityManager ( Doctrine DBAL), the oracle trigger 
audit table's use_name field is null. - it gets the value from Oracle 
sys_context ( client_identifier). 
Before running the "oci_set_client_identifier", it was getting the oracle 
database login account username. now it is null. So it seems the postConnect 
did change the  
client_identifier, is Doctrine sql execution similar to this:


$s = oci_parse($c, 'select mydata from mytable');
oci_execute($s);

(sample from 
https://www.php.net/manual/en/function.oci-set-client-identifier.php)

if not, how do modify it?

Thanks!


On Tuesday, 23 April 2019 17:07:08 UTC-4, Marco Pivetta wrote:
>
> This is most likely something that you'd do directly with the OCI8 
> extension right after connecting via DBAL.
>
>
> Marco Pivetta 
>
> http://twitter.com/Ocramius      
>
> http://ocramius.github.com/
>
>
> On Tue, Apr 23, 2019 at 10:01 PM <[email protected] <javascript:>> wrote:
>
>> in a API project I am working on, we need to pass the login user info ( 
>> user name) to the backend Oracle  sys_context for auditing purpose, 
>> basically like this:
>> php: oci_set_client_identifier
>>
>> // Find the application user's login name
>> session_start();
>> $un = my_validate_session($_SESSION['username']);
>> $c = oci_connect('myschema', 'welcome', 'localhost/XE');
>>
>> // Tell Oracle who that user is
>> oci_set_client_identifier($c, $un);
>>
>> // The next round-trip to the database will piggyback the identifier
>> $s = oci_parse($c, 'select mydata from mytable');
>> oci_execute($s);
>>
>>
>> how do we do this in Doctrine?  any suggestions?
>>
>>
>> Thanks!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "doctrine-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/doctrine-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to