On 2010-06-08 15:41:11 +0100, Martin Hall wrote: > It sounds to me as if you're running into something else. As far as I > know, the 2396 error should not be triggered during a select as the > connection is not 'idle'. Could it be that your select statement is > finishing more quickly than you thought and you're not picking it up? > If that was the case, then your session could be described as 'idle'
I think it is more likely that the select in question is the first select *after* the connection has been closed because it is idle. As long the script is busy doing something else it won't notice that connection has gone away, but when it then tries to send the next request to the db it gets the error. > On 08/06/2010 14:54, Juan Carlos García wrote: >> I have a program that takes around six or seven hours to execute. >> I don't kwon when but, during the execution of a SELECT statement, I >> get this error: >> >> DBD::Oracle::db prepare failed: ORA-02396: exceeded maximum idle time, >> please connect again (DBD ERROR: OCIStmtExecute/Describe) [for >> Statement ........ >> >> The cause of the error is clear for me. But the problem is, how to >> resolve it? Either ask your DBA to increase the allowed idle time or change your script to reconnect if necessary. A variant of the latter is to explicitely close the connection before the long idle time and reopen it when you need the database again. >> What should I do to reconnect with the database when I suffer a >> disconnection? The same thing you did to connect to the database in the first place. You may also have to redo the transaction which was in progress at the time of the disconnect (so it's probably a good idea to structure your application in such a way that there are no long idle times in the middle of a transaction). hp -- _ | Peter J. Holzer | Auf jedem Computer sollte der Satz Ludwigs II |_|_) | Sysadmin WSR | eingeprägt stehen: "Ein ewig Rätsel will ich | | | h...@wsr.ac.at | bleiben, mir und andern." __/ | http://www.hjp.at/ | -- Wolfram Heinrich in desd
signature.asc
Description: Digital signature