Re: Problem with a conection..

[email protected] (Michael Ludwig)
Newsgroups perl.dbi.users
Message-ID <20100608144942.GF1448@wladimir>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.