Home » SQL & PL/SQL » SQL & PL/SQL » Creating a New Session (Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit,OS: XP Window )
Creating a New Session [message #579683] Thu, 14 March 2013 01:18 Go to next message
chandan.rattan
Messages: 84
Registered: December 2008
Location: India
Member

HI can anyone tell me how to create a new session from a pl/sql. My requirement is that i will package which should run on new session and execute it.

BEGIN 

A; --Calling package 
B; --Calling package and this should run on new session.

C; --Calling Package

end; 


Now when I will run the this plsql block, then A,C should execute will run in this package only but B will run separate session.Whole idea to have better performance.

I heard we can use PRGMA AUTONOMOUS_TRANSACTION, but this is not working.
Re: Creating a New Session [message #579686 is a reply to message #579683] Thu, 14 March 2013 01:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ You cannot create a new session in PL/SQL but it is possible depending on what you ACTUALLY need. For instance, why you want to execute a procedure in another session.
2/ "It is not working" is not an Oracle error and does not help in anything to know why "it is not working". So explain what "it is not working" means.

Use SQL*Plus and copy and paste your session, the WHOLE session.

Regards
Michel
Re: Creating a New Session [message #579690 is a reply to message #579686] Thu, 14 March 2013 01:47 Go to previous messageGo to next message
chandan.rattan
Messages: 84
Registered: December 2008
Location: India
Member

Hi all i think i have got the answer. Below link would very helpful.

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3533747242374
Re: Creating a New Session [message #579692 is a reply to message #579686] Thu, 14 March 2013 01:52 Go to previous message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If the purpose is to run in parallel and if the third package does not rely on anything from the second one and if you don't want to roll back what has done the first package, you can use something like:
A) call first package
B) dbms_job(;j, 'call second package;'); commit;
C) call third package

Regards
Michel
Previous Topic: error when create a view
Next Topic: Count number of elements in an array.
Goto Forum:
  


Current Time: Sat Apr 27 10:56:53 CDT 2024