Hola Ju�n,

juancarg schrieb am 08.06.2010 um 06:52 (-0700):
> Hi.
> 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?
> What should I do to reconnect with the database when I suffer a
> disconnection?

One solution might be to have your script issue a dummy query like
"select 1 from dual" once in a while to avoid being disconnected for
idling around.

The MySQL driver (DBD::mysql) has the mysql_auto_reconnect attribute
that will take care of lost connections. Haven't been able to find
anything similar in DBD::Oracle, but then I didn't search thoroughly,
just scanning for "connect" and "time" and "idle".

You could probably also ask the DBA to raise the max idle time.

-- 
Michael Ludwig

Reply via email to