Home » Developer & Programmer » JDeveloper, Java & XML » How Java threads are mapped to PL/SQL execution threads?? (Oracle 10g, Solaris-10)
How Java threads are mapped to PL/SQL execution threads?? [message #362525] Tue, 02 December 2008 12:01 Go to next message
uniqhemant
Messages: 2
Registered: December 2008
Location: India
Junior Member
Hi thr,

I have a basic query about how multi-threading is implemented in Oracle.
I have a Java application which executes PL/SQL procedure of a package. The procedure has one global variable defined in it(say X) and the Java application is multi-threaded - so the procedure can be executed simultaneously by 2 different Java threads.
Now the question is - how the global variable X will be accessed by 2 threads? (means will both the threads get same copy of variable or will they get different versions of it?)

let me know if i am not clear...

Would appreciate a quick response.. Razz

Thanks in advance
Re: How Java threads are mapped to PL/SQL execution threads?? [message #362526 is a reply to message #362525] Tue, 02 December 2008 12:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Variables are associated to session.
So if you have one session per thread, each one has its copy of the variables; if the threads share one session, the threads also share the variables.

Regards
Michel
Re: How Java threads are mapped to PL/SQL execution threads?? [message #362812 is a reply to message #362526] Thu, 04 December 2008 03:24 Go to previous messageGo to next message
uniqhemant
Messages: 2
Registered: December 2008
Location: India
Junior Member
Thanks Michael for your response..

I hope that the session which you are talking about is java Session and not some oracle session (however i am not aware of any such thing).

Below i am trying to explain my understanding as per your response. Pls. Correct me if it doesn't seem sound to you.

Considering an oracle package as a Java class (having variables and methods defined in it), a new instance of the package is created for each session and the global variables defined in it are non-static one, and hence will be removed once the session ends.


Regards,
Hemant
Re: How Java threads are mapped to PL/SQL execution threads?? [message #362826 is a reply to message #362812] Thu, 04 December 2008 03:54 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I hope that the session which you are talking about is java Session and not some oracle session (however i am not aware of any such thing).

I was talking about PL/SQL package variables and Oracle session.

Regards
Michel
Previous Topic: Problem Generating Web Service Proxy (WSDL/XSD) , WCF service
Next Topic: ORA-19025: EXTRACTVALUE returns value of only one node
Goto Forum:
  


Current Time: Thu Mar 28 16:27:25 CDT 2024