Linking Perl procedure with Oracle Package [message #270647] |
Thu, 27 September 2007 13:34  |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Hi, I'd like to know if someone could explain me how can I create and call Perl procedures and functions(there are like 10) from a PLSQL Package which only should retrieve the values and use them sometimes.
Thanks in advance!.
|
|
|
|
|
Re: Linking Perl procedure with Oracle Package [message #270671 is a reply to message #270647] |
Thu, 27 September 2007 14:03   |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Hi, thanks for answering so fast. The problem is that we have a package with a lot of procedures and functions that consult an LDAP tree to obtain users information. The thing is that when we stress it out, we always have WAIT's and EXCEPTION's like:
ERROR: -31203 - ORA-31203: DBMS_LDAP: PL/SQL - Init Failed.
ERROR: -31204 - ORA-31204: DBMS_LDAP: PL/SQL - Invalid LDAP Session.
And we don't have any problem with the LDAP.
This happens arbitrarily, we can't reproduce the problem. Testing, we realized that the DBMS_LDAP was having problems or causing the WAIT's. So, we decided to REUSE a PERL code that we have that makes all the same things that our PLSQL package does. As we need it to be transparent for the user, we also decided that the procedure calls should stay the same, but the backend change.
That's the reason why PLSQL should call PERL procedures.
|
|
|
|
Re: Linking Perl procedure with Oracle Package [message #270681 is a reply to message #270672] |
Thu, 27 September 2007 14:23   |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
All of the procedures and functions obtain the Host and Port from a table that contains all the services available. If one fails, all of them should, and they don't. Plus, this happens only when we stress it out with a lot of concurrent users. It's like DMBS_LDAP has problems, like a bottle neck.
|
|
|
Re: Linking Perl procedure with Oracle Package [message #270737 is a reply to message #270681] |
Thu, 27 September 2007 22:38   |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Calling Perl from PL/SQL is just plain bad design. It might solve the problem you are having, but it will introduce countless new problems.
If you want to use a language other than PL/SQL, there are two generally accepted methods:
- Server-based: As suggested above, call External Procedures in C or Java (I don't think others are supported, certainly Perl is not)
- Client-based: Drive your program FROM Perl, and embed Perl::DBI calls to Oracle. The same methodology works with other client-based technologies; including Pro*C, PHP, and anything that can link to OCI.
Ross Leishman
|
|
|
|
|
Re: Linking Perl procedure with Oracle Package [message #271016 is a reply to message #270647] |
Fri, 28 September 2007 13:56   |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
For myself I didn't do it like this, to many points of failure.
Hi Michel, thank you for answering so fast. Could you explain me some points of failure it could have to advice my superiors?. Perl has a module called extproc_perl-2.51 that allowes you to create external procedures for Oracle. The thing is that every documentation says that Oracle supports Java and C. I hope I can make them understand this thing you tell me.
Thank you for all the help.
|
|
|
|
Re: Linking Perl procedure with Oracle Package [message #271035 is a reply to message #270647] |
Fri, 28 September 2007 14:42  |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Yes, I've read some of this stuff that the DBA has to change to make this work. I'm trying to stop this process and keep making efforts to solve the problem that the DBMS_LDAP is having as I think this is the correct way to do this. I hope we can figure out the reason that's causing those exceptions and bottle necks. Thanks Michel for your help.
|
|
|