Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Application contexts in multi-user environments
[Oracle9i Enterprise Edition Release 9.2.0.3.0]
Hi,
I'm experimenting with application contexts as a means of utilizing bind variables in variable WHERE clauses.
In a multi-user environment where the database is accessed from an application using a single user id, are there any conflicts involved when the same procedure is accessed multiple times and the same context variable is set to different values by each call? In other words, can I assume that between the time the user_id of my_context is set and the query is executed in procedure call 1 that those values will be used and not be affected by other procedure calls also setting the user_id of my_context?
Thanks,
Ed Holloman
In procedure call 1 to my_proc:
'WHERE user_id = sys_context(''my_context'',''user_id'')';
dbms_session.set_context('my_context', 'user_id', '12345');
OPEN my_refcursor FOR
my_query;
In procedure call 2 to my_proc:
'WHERE buyer_id = sys_context(''my_context'',''user_id'')';
dbms_session.set_context('my_context', 'user_id', '45678');
OPEN my_refcursor FOR
my_query;
etc. Received on Sun Apr 18 2004 - 22:46:34 CDT