Yes, i have assumed this 
Now it is much clearer. You have 1 DB user and many application user. 
Then yes, context var is your friend

regards,
Karol Bieniaszewski

From: marco andreolli [email protected] [firebird-support] 
Sent: Saturday, February 17, 2018 9:03 AM
To: [email protected] 
Subject: Re: [firebird-support] Re: Set custom value on connection system info

  

Hi, sorry Karol if I dont't reply until now.


I think you you assume I have a Firebird user for any user application, but I 
have a only one firebird user for all my application. So 
MON$ATTACHEMNTS..MON$USER is the same for all connections!




Il 10 feb 2018 16:46, "'livius' [email protected] [firebird-support]" 
<[email protected]> ha scritto:

    
  Hi,

  you store in your persistent table login (user_name) it is presistent 
information.
  You join your persistent table which should contain login name and you join 
your persistent table with mon$attachment an you know who is currently logged 
in.

  once again sample

  CREATE TABLE MY_USERS
  (USER_ID INTEGER NOT NULL PRIMARY KEY,
  NAME VARCHAR(32) NOT NULL,
  AGE INTEGER,
  .....
  LOGIN_NAME VARCHAR(32) NOT NULL
  );

  sample record
  USER_ID=1
  NAME=’Karlos’
  AGE=52
  ....
  LOGIN_NAME=’SYSDBA’ 

  and you run sql

  SELECT * FROM MY_TABLE MT INNER JOIN MON$ATTACHEMNTS A ON 
A.MON$USER=MT..LOGIN_NAME

  regards,
  Karol Bieniaszewski

  From: marco andreolli [email protected] [firebird-support] 
  Sent: Saturday, February 10, 2018 9:15 AM
  To: [email protected] 
  Subject: Re: [firebird-support] Re: Set custom value on connection system info

  Hi, 

  I have a table of users, but I wouldn't store in persistent table a volatile 
information (if it was possible).

  The link between a connection id and user id isn't a persistent information 
(like connections,transaction ecc...)

  2018-02-08 6:19 GMT+01:00 liviuslivius [email protected] 
[firebird-support] <[email protected]>:

  Hi,

  what do you mean by maintain here? Do you have custom user information table 
or not? If not then what do you need to store in this context var?

  I supposed that you have custom user information table and you need to match 
your user record with server user to know who is logged into the server..

  Regards, 
  Karol Bieniaszewski

  [Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]

Reply via email to