Re: Does an explicit database close method exist?
[prev]
[thread]
[next]
[Date index for 2004/09/20]
Thanks Car! - you put me on the right track. This is what I settled on
to disconnect the database:
Class::DBI->set_db( 'Main', "dbi:Oracle:$db" );
# This succeeds as expected.
@rows = SOME_DBI_CLASS->search( some_column => 8 );
# Return all database handles
@dbh = SOME_DBI_CLASS->db_handles;
# I only have interest in first because I only have one DB connection.
$dbh = $dbh[0];
$dbh->disconnect;
# this will fail because of disconnected database.
$dbh->do( q{ some_sql } );
# This will succeed because Class::DBI auto reconnects.
@rows = SOME_DBI_CLASS->search( some_column => 8 );
On Sep 20, 2004, at 8:14 AM, Carl Johnstone wrote:
>
> need to explicitly close the database. But now I have a
>> situation where I would like to close and reopen later -
>> could be much later. The close would not occur until after I
>> inserted some data. I read Class::DBI and Ima::DBI docs and
>> could not find a way. Is there one?
>
> Can you undef the DB handle?
>
> Carl
> --------------------------------------------------------
> GMG Regional Digital is part of the Guardian Media Group plc.
>
>
>
>
> CONFIDENTIALITY NOTICE. The information contained in this e-mail is
> intended only for rrom@xxx.xxxxxxxxx.xxx, cdbi-talk@xxxxxx.xxxxx.xxx.
> It may contain privileged and confidential information that is exempt
> from disclosure by law and if you are not an intended recipient, you
> must not copy, distribute or take any action in reliance on it. If you
> have received this e-mail in error, you may notify us by telephone on
> 44 (0)161 832 7200. E-mail transmission cannot be guaranteed to be
> secure or error-free. The sender (carl.johnstone@xxxxx.xx.xx)
> therefore does not accept liability for any errors or omissions in the
> contents of this message, which arise as a result of e-mail
> transmission. If verification is required please request a hard-copy
> version.
>
>
>
>
>
>
>