<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SYS_CONTEXT in Oracle</title>
	<atom:link href="http://awads.net/wp/2005/08/05/sys_context-in-oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2005/08/05/sys_context-in-oracle/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Tue, 16 Mar 2010 23:11:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pete Johnson</title>
		<link>http://awads.net/wp/2005/08/05/sys_context-in-oracle/comment-page-1/#comment-50805</link>
		<dc:creator>Pete Johnson</dc:creator>
		<pubDate>Wed, 23 May 2007 07:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=97#comment-50805</guid>
		<description>&lt;p&gt;Hi All&lt;/p&gt;

&lt;p&gt;I have a database on which users can execute queries. To ensure they cant view each others information I want to execute this query first:
dbms_session.set_context(&#039;usernameParam&#039;, &#039;username&#039;, username);
I then want to create views that look like this:
CREATE OR REPLACE VIEW &quot;MyView&quot; AS SELECT * FROM &quot;DB&quot;.&quot;MyTable&quot;
 WHERE &quot;Username&quot; = SYS_CONTEXT(&#039;usernameParam&#039;, &#039;username&#039;)
/
I then want my clients to use the views instead of tables.&lt;/p&gt;

&lt;p&gt;I am doing this using Java. I get a database connection. Using that connection I execute the set_context query. I am wandering, how thread safe is this? If 2 clients at the same time execute a query is it possible that the set_context will be execute in the wrong order and clients see each others information or does the set_context apply only to the current connection even thought the same username is used to connect to the database?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi All</p>

<p>I have a database on which users can execute queries. To ensure they cant view each others information I want to execute this query first:
dbms_session.set_context(&#8216;usernameParam&#8217;, &#8216;username&#8217;, username);
I then want to create views that look like this:
CREATE OR REPLACE VIEW &#8220;MyView&#8221; AS SELECT * FROM &#8220;DB&#8221;.&#8221;MyTable&#8221;
 WHERE &#8220;Username&#8221; = SYS_CONTEXT(&#8216;usernameParam&#8217;, &#8216;username&#8217;)
/
I then want my clients to use the views instead of tables.</p>

<p>I am doing this using Java. I get a database connection. Using that connection I execute the set_context query. I am wandering, how thread safe is this? If 2 clients at the same time execute a query is it possible that the set_context will be execute in the wrong order and clients see each others information or does the set_context apply only to the current connection even thought the same username is used to connect to the database?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: SIVASANKARAN</title>
		<link>http://awads.net/wp/2005/08/05/sys_context-in-oracle/comment-page-1/#comment-50337</link>
		<dc:creator>SIVASANKARAN</dc:creator>
		<pubDate>Wed, 14 Feb 2007 06:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=97#comment-50337</guid>
		<description>&lt;p&gt;Execellent ... It is veryful for me.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Execellent &#8230; It is veryful for me.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Vollman</title>
		<link>http://awads.net/wp/2005/08/05/sys_context-in-oracle/comment-page-1/#comment-83</link>
		<dc:creator>Robert Vollman</dc:creator>
		<pubDate>Tue, 09 Aug 2005 23:51:55 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=97#comment-83</guid>
		<description>&lt;p&gt;Yes!&lt;/p&gt;

&lt;p&gt;We&#039;re on the same page.  I discovered this handy thing around the same time:&lt;/p&gt;

&lt;p&gt;http://thinkoracle.blogspot.com/2005/07/which-instance-am-i-in.html&lt;/p&gt;

&lt;p&gt;Very handy!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes!</p>

<p>We&#8217;re on the same page.  I discovered this handy thing around the same time:</p>

<p><a href="http://thinkoracle.blogspot.com/2005/07/which-instance-am-i-in.html" rel="nofollow">http://thinkoracle.blogspot.com/2005/07/which-instance-am-i-in.html</a></p>

<p>Very handy!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://awads.net/wp/2005/08/05/sys_context-in-oracle/comment-page-1/#comment-75</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Mon, 08 Aug 2005 22:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=97#comment-75</guid>
		<description>&lt;p&gt;There is a similar function called &lt;code&gt;USERENV&lt;/code&gt;. But based on the &lt;a href=&quot;http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions162a.htm#1019148&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;USERENV is a legacy function that is retained for backward compatibility. Oracle Corporation recommends that you use the SYS_CONTEXT function with the built-in USERENV namespace for current functionality&lt;/blockquote&gt;
</description>
		<content:encoded><![CDATA[<p>There is a similar function called <code>USERENV</code>. But based on the <a href="http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions162a.htm#1019148">documentation</a>:</p>

<blockquote>USERENV is a legacy function that is retained for backward compatibility. Oracle Corporation recommends that you use the SYS_CONTEXT function with the built-in USERENV namespace for current functionality</blockquote>]]></content:encoded>
	</item>
</channel>
</rss>
