Re: Does an explicit database close method exist?

[prev] [thread] [next] [Date index for 2004/09/20]

From: Robert Rombaut
Subject: Re: Does an explicit database close method exist?
Date: 14:29 on 20 Sep 2004
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.
>
>
>
>
>
>
>

RE: Does an explicit database close method exist?
Carl Johnstone 12:14 on 20 Sep 2004

Re: Does an explicit database close method exist?
Robert Rombaut 14:29 on 20 Sep 2004

RE: Does an explicit database close method exist?
Carl Johnstone 14:45 on 20 Sep 2004

Re: Does an explicit database close method exist?
Robert Rombaut 22:04 on 21 Sep 2004

Re: Does an explicit database close method exist?
Perrin Harkins 22:15 on 21 Sep 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52