Hi all

We're in the early stages of an attempt to migrate from AOLserver to 
Naviserver. For now, we're just looking at the Windows version of Naviserver, 
but I guess this might be an issue on Unix versions too.

We've already run into an issue with some OpenACS code that that uses "open" to 
open a pipe to Oracle's SQL*Plus command, and then runs a SQL script. It looks 
like AOLserver was doing something extra, which Naviserver doesn't seem to do.

As a bit of background, when you run a SQL script in SQL*Plus, the script needs 
to have an EXIT command on the last line, which tells SQL*Plus to exit when 
finished. For some reason, in OpenACS, none of the provided SQL scripts have 
this EXIT, but with AOLserver it was never an issue. It seemed to close the 
channel after SQL*Plus was finished running.

With Naviserver, the pipe hangs while waiting on SQL*Plus to exit. The obvious 
fix is to add the EXIT to the 1000s of SQL scripts included in OpenACS, but I'm 
hoping there's a smarter solution (something along the lines of this, if 
necessary http://serverfault.com/a/87038/9044 ).

Here's an example of what I'm talking about:

Create a file called hello.sql which contains the following line:
select 'brian says hi' from dual;

>From your command line, run it as follows:
sqlplus user/pass@SID @hello.sql

You will find that it doesn't exit the SQL*Plus session, unless you add an EXIT 
to the end of hello.sql

Here is a version of the OpenACS code, that works on AOLserver (without the 
EXIT command in the SQL script) but is hanging on Naviserver:
set file "c:/temp/hello.sql"
cd [file dirname $file]
set user_pass "user/pass@SID"
set fp [open "|[file join $::env(ORACLE_HOME) bin sqlplus] $user_pass @$file" 
"r"]
set output ""
while { [gets $fp line] >= 0 } {
  append output $line
}
close $fp
ns_log Notice $output


If hello.sql has an EXIT, you will see output similar to below. Otherwise, it 
just waits, and you have to kill it.
SQL*Plus: Release 12.1.0.2.0 Production on Fri Feb 17 16:45:34 2017Copyright (c)
1982, 2014, Oracle.  All rights reserved.Connected to:Oracle Database 11g Relea
se 11.2.0.3.0 - 64bit Production'BRIANSAYSHI'-----------------------------------
----brian says hiDisconnected from Oracle Database 11g Release 11.2.0.3.0 - 64bi
t Production


Any thoughts?
Brian








This e-mail transmission may contain confidential information that is intended 
for the individual or entity named on the e-mail address. If you are not the 
intended recipient, please reply to the sender so that Quest Computing Ltd can 
arrange for the proper delivery and then please delete the message from your 
inbox.

If you have received this e-mail in error, you are hereby notified that any 
disclosure, copying, distribution, or reliance upon the contents of this e-mail 
is strictly prohibited. Quest Computing Ltd., Ushers Court, 31-33 Ushers Quay, 
Dublin 8, Ireland. Quest Computing Ltd. is registered in Ireland No. 146435.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to