Home » Open Source » Programming Interfaces » Downloaded 114 BLOBS using PHP before getting ORA-12537: TNS Connection Closed
Downloaded 114 BLOBS using PHP before getting ORA-12537: TNS Connection Closed [message #643998] Sat, 24 October 2015 15:25 Go to next message
jdrogers73
Messages: 2
Registered: October 2015
Junior Member
I am running a very basic PHP script on a Redhat Linux box to download photos. I can connect to Oracle with no problem. 114 BLOBS are downloaded before getting ORA-12537 TNS: Connection Closed. Why is it closing? I need to download 2,114 BLOBS.

This is the algorithm:

query = "SELECT picture FROM table WHERE id_number = :id";

foreach(id number)
{
prepare query
execute query
bind column
fetch
array[id] = picture;
}

print_r(array);
exit;

[Updated on: Sat, 24 October 2015 15:26]

Report message to a moderator

Re: Downloaded 114 BLOBS using PHP before getting ORA-12537: TNS Connection Closed [message #644001 is a reply to message #643998] Sat, 24 October 2015 18:29 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
12537, 00000, "TNS:connection closed"
// *Cause: "End of file" condition has been reached; partner has disconnected.
// *Action: None needed; this is an information message.

Oracle, itself, has NO networking capability & depends 100% upon the underlying OS.

Based upon the sparsity of clues & evidence, I suspect some sort of timeout/disconnect occurs.
Does any FireWall exist on or between client & DB Server?
Re: Downloaded 114 BLOBS using PHP before getting ORA-12537: TNS Connection Closed [message #644033 is a reply to message #644001] Mon, 26 October 2015 07:37 Go to previous messageGo to next message
jdrogers73
Messages: 2
Registered: October 2015
Junior Member
Hello BlackSwan,

Thank you for taking the time to consider my question and reply. So, what you are saying is SQL PLUS, which is on the application server, is probably throwing the error because its connection to the database closed. I was assuming since the error was from Oracle, it was a database issue. Thanks for the turning my attention to the network. There are two firewalls: one on the Linux application server and one on the Linux database server. There could also be a firewall between the servers.

Jim
Re: Downloaded 114 BLOBS using PHP before getting ORA-12537: TNS Connection Closed [message #644036 is a reply to message #644033] Mon, 26 October 2015 08:36 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Oracle simply reports a change in its reality.
Oracle is the victim; not the culprit.

Re: Downloaded 114 BLOBS using PHP before getting ORA-12537: TNS Connection Closed [message #647171 is a reply to message #644036] Thu, 21 January 2016 03:49 Go to previous message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
I don't really know PHP, but in Perl or Java you have to "close" the query again. Otherwise you might run into too much open cursors (ORA-01000 maximum open cursors exceeded).

Since PHP is notoriously bad at reporting errors, it might be you run into THAT during the "prepare", but it's not reported, only the "connection closed" is reported later on....

Previous Topic: How to SELECT XMLTYPE data with Perl DBD::Oracle?
Next Topic: synchronizing data from sql server
Goto Forum:
  


Current Time: Sat Dec 21 10:03:48 CST 2024