Result:
found more than 865 distributions - search limited to the first 2001 files matching your query ( run in 1.667 )


DBD-DtfSQLmac

 view release on metacpan or  search on metacpan

samples/dbi_3_connect.pl  view on Meta::CPAN


print "\n\nDisconnecting connection 1 ... ";
$dbh1->disconnect;
print "ok.\n\n";

print "Sent a ping to connection 1 to see if the connection is alive (this should fail).\n\n";
my $alive = $dbh1->ping();
print "ping ...";
($alive) ? print " still alive.\n\n" : print " connection dead.\n\n";


print "Try a second connection after the first has been closed (this should work) ... ";
my $dbh3 = DBI->connect(	$dsn, 
							'dtfadm', 
							'dtfadm', 
							{RaiseError => 1, AutoCommit => 0}
					   ) ||  die "Can't connect to database: " . DBI->errstr;
print "ok.\n\n";

print "Sent a ping to the second connection to see if connection is alive (this should work).\n\n";
$alive = $dbh3->ping();
print "ping ...";
($alive) ? print " still alive.\n\n" : print " connection dead.\n\n";

print "\nDisconnecting ... ";
$dbh3->disconnect;
print "ok.\n\n";

 view all matches for this distribution


DBD-Informix

 view release on metacpan or  search on metacpan

lib/DBD/Informix/TestHarness.pm  view on Meta::CPAN


When it is called, memory_leak_test forks, and the parent process runs
the given subroutine with no arguments.
The subroutine will do the sequence of database operations which show
that there is a memory leak, or that the memory leak is fixed.
The child process checks that the parent is still alive, and runs the
C<ps> command to determine the size of the process.
The output of C<ps> is not parsed, so you have to run the test in a
verbose mode to see whether there is a memory leak or not.

    &memory_leak_test(\&test_subroutine);

 view all matches for this distribution


DBD-JDBC

 view release on metacpan or  search on metacpan

lib/DBD/JDBC.pm  view on Meta::CPAN

                             $dbh->FETCH('jdbc_socket'), $dbh->FETCH('jdbc_ber'),
                             [ROLLBACK_REQ => 0],
                             [ROLLBACK_RESP => \$resp]);
    }

    # Confirms that the server is alive and that this particular
    # (JDBC) connection has not been closed.
    #
    # JDBC: Connection.isClosed
    sub ping {
        my ($dbh) = shift;

 view all matches for this distribution


DBD-SQLAnywhere

 view release on metacpan or  search on metacpan

SQLAnywhere.pm  view on Meta::CPAN

	# Strictly speaking, the prepare() could fail due to an error
	# reported from the server (eg. if we exceed the prepared statement
	# limit) but we don't have access to the ping facility through DBCAPI
	# so this is usually a valid test.
	my $rv = eval { $dbh->prepare( "select 1" ); };
	my $alive = ( defined( $rv ) ? 1 : 0 );

	# Suppress the error for ping() -- it should just return a boolean without reporting error
	$dbh->set_err( undef, undef );

	return( $alive );
    }


# Use the DBI-provided quote routine
#    sub quote {

 view all matches for this distribution


DBD-Safe

 view release on metacpan or  search on metacpan

lib/DBD/Safe.pm  view on Meta::CPAN


Connection is checked on each query. This can double your request execution time if all your requests are fast and network latency of your database is big enough.

Statement objects are not safe. Once you've prepared the statement, it won't reconnect to the database transparently.

There are no retries. If the request fails, it fails. This module just check that DB is alive *before* it tries to execute the statement. (Custom, per-query policies support is planned for the future releases).

=head1 SEE ALSO

L<http://github.com/tadam/DBD-Safe>,
L<DBIx::Connector>, L<DBIx::HA>, L<DBIx::DWIW>.

 view all matches for this distribution


DBD-Sybase

 view release on metacpan or  search on metacpan

Sybase.pm  view on Meta::CPAN


Tell DBD::Sybase what the server type is. Defaults to ASE. Setting it to 
something else will prevent certain actions (such as setting options, 
fetching the ASE version via @@version, etc.) and avoid spurious errors.

=item tds_keepalive

Set this to 1 to tell OpenClient to enable the KEEP_ALIVE attribute on the 
connection. Default 1.

=back

 view all matches for this distribution


DBD-Wire10

 view release on metacpan or  search on metacpan

lib/DBD/Wire10.pm  view on Meta::CPAN


=head4 reconnect

Makes sure that there is a connection to the database server.  If there is no connection, and the attempt to reconnect fails, an error is reported via the standard DBI error reporting mechanism.

Notice that the timeout when calling this method is in a sense doubled.  reconnect() first performs a ping() if the connection seems to be alive.  If the ping fails after C<wire10_connect_timeout> seconds, then a new underlying connection is establis...

=head4 err

Contains an error code when an error has happened.  Always use RaiseError and eval {} to catch errors in production code.

 view all matches for this distribution


DBD-cubrid

 view release on metacpan or  search on metacpan

cci-src/src/cci/cci_handle_mng.c  view on Meta::CPAN

      start_time = time (NULL);
      for (i = 0; i < host_status_count; i++)
	{
	  ip_addr = host_status[i].host.ip_addr;
	  port = host_status[i].host.port;
	  if (!host_status[i].is_reachable && net_check_broker_alive (ip_addr, port, BROKER_HEALTH_CHECK_TIMEOUT))
	    {
	      hm_set_host_status_by_addr (ip_addr, port, true);
	    }
	}
      elapsed_time = time (NULL) - start_time;

 view all matches for this distribution


DBI-Shell

 view release on metacpan or  search on metacpan

lib/DBI/Shell.pm  view on Meta::CPAN

sub do_ping {
    my ($sh, @args) = @_;
    return $sh->print_buffer_nop (
	"Connection "
	, $sh->{dbh}->ping() == '0' ? 'Is' : 'Is Not'
	, " alive\n" );
}

sub do_edit {
    my ($sh, @args) = @_;

 view all matches for this distribution


DBI

 view release on metacpan or  search on metacpan

lib/DBD/DBM.pm  view on Meta::CPAN

    my $dver;
    my $dtype = $meta->{dbm_type};
    eval {
        $dver = $meta->{dbm_type}->VERSION();

        # *) when we're still alive here, everything went ok - no need to check for $@
        $dtype .= " ($dver)";
    };
    if ( $meta->{dbm_mldbm} )
    {
        $dtype .= ' + MLDBM';

 view all matches for this distribution


DBIx-Abstract

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

       - Made it so that opt can now take any DBI attribute.

1.000  2001-09-04
       - Now produces a better error that config/DSN is not defined.
       - When the DBIx::Abstract object is destroyed it usually closes any
         associated database handles (if it's the last clone alive), now it
         will only do this if it created the handle.  This way, if you pass
         in a handle it will survive its use by DBIx::Abstract.

0.96   2001-07-07
       - Fixed stupid bug that made it not accept DBI handles.  I can't

 view all matches for this distribution


DBIx-Class-Async

 view release on metacpan or  search on metacpan

lib/DBIx/Class/Async.pm  view on Meta::CPAN

    # CRITICAL ORDER: remove() MUST be called BEFORE stop().
    #
    # IO::Async::Function::stop() sets an internal {stopping} flag and
    # begins tearing down IPC channels. Once that flag is set, remove()
    # silently fails - the notifier stays in the loop's internal registry,
    # keeping the loop (and its SIGCHLD handler) alive past the point where
    # we expect them to be freed. During Perl global destruction the loop's
    # XS destructor then accesses already-freed memory -> SEGV.
    #
    # Calling remove() first detaches the Function and all its child
    # notifiers (Streams, Handles, Processes) cleanly, then stop() signals

lib/DBIx/Class/Async.pm  view on Meta::CPAN

                    elsif ($operation eq 'txn_rollback') {
                        $schema->storage->txn_rollback;
                        return { success => 1 };
                    }
                    elsif ($operation eq 'ping') {
                        my $alive = eval { $schema->storage->dbh->do("SELECT 1") };
                        return { success => ($alive ? 1 : 0), status => "pong" };
                    }
                    else {
                        die "Unknown operation: $operation";
                    }
                }

 view all matches for this distribution


DBIx-Class-CompressColumns

 view release on metacpan or  search on metacpan

lib/DBIx/Class/CompressColumns.pm  view on Meta::CPAN

L<DBIx::Class>,
L<Compress::Zlib>

=head1 AUTHOR

Jesse Stay (jessestay) <jesse@staynalive.com>

A Product of SocialToo.com

=head1 LICENSE

 view all matches for this distribution


DBIx-Class-CustomPrefetch

 view release on metacpan or  search on metacpan

Debian_CPANTS.txt  view on Meta::CPAN

"libpod-xhtml-perl", "Pod-Xhtml", "1.59", "0", "0"
"libpod2-base-perl", "POD2-Base", "not-uploaded", "0", "0"
"libpoe-api-peek-perl", "POE-API-Peek", "1.3400", "0", "0"
"libpoe-component-client-dns-perl", "POE-Component-Client-DNS", "1.051", "0", "0"
"libpoe-component-client-http-perl", "POE-Component-Client-HTTP", "0.890", "0", "0"
"libpoe-component-client-keepalive-perl", "POE-Component-Client-Keepalive", "0.2600", "0", "0"
"libpoe-component-client-mpd-perl", "POE-Component-Client-MPD", "0.9.6", "0", "0"
"libpoe-component-ikc-perl", "POE-Component-IKC", "0.2200", "0", "0"
"libpoe-component-irc-perl", "POE-Component-IRC", "6.16", "0", "0"
"libpoe-component-jabber-perl", "POE-Component-Jabber", "3.00", "0", "0"
"libpoe-component-jobqueue-perl", "POE-Component-JobQueue", "0.5700", "0", "0"

 view all matches for this distribution


DBIx-Class-FormTools

 view release on metacpan or  search on metacpan

t/22.one_to_many_fields.t  view on Meta::CPAN

### Create a form with 1 existing objects with one non existing releation
my $formdata = {
    # The existing objects
    $helper->fieldname($film, 'title',      'o1') => 'Sound of music',
    $helper->fieldname($film, 'length',     'o1') => 100,
    $helper->fieldname($film, 'comment',    'o1') => 'The hills are alive...',
    $helper->fieldname($film, 'location_id','o1') => 'o2',
    $helper->fieldname($location, 'name',   'o2') => 'Somewhere over the rainbow',
};
ok(1,"Formdata created:\n".pp($formdata));

 view all matches for this distribution


DBIx-Class-Schema-Loader-DBI-RelPatterns

 view release on metacpan or  search on metacpan

t/10loader.t  view on Meta::CPAN

        quiet => 0,
        test_rels => [
            'Bars.quuxref' => 'quuxs.quuxid', # foreign key
        ],
    );
} "the loader managed to stay alive";

lives_and {
    $schema2 = make_schema(
        loader_class => 1,
        no_increment => 1,

 view all matches for this distribution


DBIx-Class

 view release on metacpan or  search on metacpan

lib/DBIx/Class/Manual/Cookbook.pod  view on Meta::CPAN

An easy way to use transactions is with
L<DBIx::Class::Storage::TxnScopeGuard>. See L</Automatically creating
related objects> for an example.

Note that unlike txn_do, TxnScopeGuard will only make sure the connection is
alive when issuing the C<BEGIN> statement. It will not (and really can not)
retry if the server goes away mid-operations, unlike C<txn_do>.

=head1 SQL

=head2 Creating Schemas From An Existing Database

 view all matches for this distribution


DBIx-Connector-Pool

 view release on metacpan or  search on metacpan

lib/DBIx/Connector/Pool.pm  view on Meta::CPAN

	my ($class, %args) = @_;
	$args{initial}   //= 1;
	$args{tid_func}  //= sub {1};
	$args{wait_func} //= sub {croak "real waiting function must be supplied"};
	$args{max_size} ||= -1;
	$args{keep_alive}     //= -1;
	$args{user}           //= ((getpwuid $>)[0]);
	$args{password}       //= '';
	$args{attrs}          //= {};
	$args{dsn}            //= 'dbi:Pg:dbname=' . $args{user};
	$args{connector_mode} //= 'fixup';

lib/DBIx/Connector/Pool.pm  view on Meta::CPAN

		--$connected_size;
	};
	my $now = time;
	for ($i = @{$self->{pool}} - 1; $i >= 0 && $connected_size > $self->{initial}; --$i) {
		if ($self->{pool}[$i]{connector} && !$self->{pool}[$i]{connector}->item_in_use) {
			if ($now - $self->{pool}[$i]{connector}->item_last_use > $self->{keep_alive}) {
				$remove_sub->();
			} else {
				$self->{pool}[$i]{tid} = undef;
			}
		} elsif (!$self->{pool}[$i]{connector}) {

lib/DBIx/Connector/Pool.pm  view on Meta::CPAN

  use Coro::AnyEvent;
  use DBIx::Connector::Pool;
  
  my $pool = DBIx::Connector::Pool->new(
    initial    => 1,
    keep_alive => 1,
    max_size   => 5,
    tid_func   => sub {"$Coro::current" =~ /(0x[0-9a-f]+)/i; hex $1},
    wait_func => sub        {Coro::AnyEvent::sleep 0.05},
    attrs     => {RootClass => 'DBIx::PgCoroAnyEvent'}
  );

lib/DBIx/Connector/Pool.pm  view on Meta::CPAN


=item B<new>
  
  my $pool = DBIx::Connector::Pool->new(
    initial    => 1,
    keep_alive => 1,
    max_size   => 5,
    tid_func   => sub {"$Coro::current" =~ /(0x[0-9a-f]+)/i; hex $1},
    wait_func => sub        {Coro::AnyEvent::sleep 0.05},
    attrs     => {RootClass => 'DBIx::PgCoroAnyEvent'}
  );

lib/DBIx/Connector/Pool.pm  view on Meta::CPAN

=item B<initial>

Initial number of connected connectors. This means also minimum of of
connected connectors. It throws error if this minimum can not be met.

=item B<keep_alive>

How long connector can live after it becomes unused. Initial connectors will
live forever. C<-1> means no limit. C<0> means collect it immediate. Positive 
number means seconds.

 view all matches for this distribution


DBIx-DataStore

 view release on metacpan or  search on metacpan

lib/DBIx/DataStore.pm  view on Meta::CPAN

against.

With load on demand in mod_perl, you end up only loading it
for a single Apache process when it's first needed.  If more than one
process needs it, more than one copy is loaded.  If those processes are
eventually killed (through max keepalive request like settings) and its
needed again, then it has to be loaded all over again.  Instead, preloading
it in the main Apache process creates a single copy available to every
child Apache process for the lifetime of that Apache run.

=head1 DATABASE METHODS

 view all matches for this distribution


DBIx-HTML

 view release on metacpan or  search on metacpan

t/01-run.t  view on Meta::CPAN

{
    $dbh   = DBI->connect ( @dbi_csv_args );
    $table = DBIx::HTML->connect( $dbh );
    isa_ok $table, 'DBIx::HTML',            "object created";
    isa_ok $table->{dbh}, 'DBI::db',        "database handle copied";
    isa_ok $dbh, 'DBI::db',                 "database alive before object expires";
}

isa_ok $dbh, 'DBI::db', "database still alive before object expires";

$dbh   = DBI->connect ( @dbi_csv_args );
$table = DBIx::HTML->connect( $dbh );
is output( 'select * from test' ),
    '<table><tr><th>Id</th><th>Parent</th><th>Name</th><th>Description</th></tr><tr><td>1</td><td>&nbsp;</td><td>root</td><td>the root</td></tr><tr><td>2</td><td>1</td><td>kid1</td><td>some kid</td></tr><tr><td>3</td><td>1</td><td>kid2</td><td>some o...

 view all matches for this distribution


DBIx-Mint

 view release on metacpan or  search on metacpan

lib/DBIx/Mint.pm  view on Meta::CPAN


This accessor/mutator will return the underlying L<DBIx::Connector> object.

=head2 dbh

This method will return the underlying database handle, which is guaranteed to be alive.
 
=head2 abstract

This is the accessor/mutator for the L<SQL::Abstract::More> subjacent object.

lib/DBIx/Mint.pm  view on Meta::CPAN


Note that it must be called as an intance method, not as a class method.
 
=head1 USE OF L<DBIx::Connector>

Under the hood, DBIx::Mint uses DBIx::Connector to hold the database handle and to make sure that the connection is well and alive when you need it. The database modification routines employ the 'fixup' mode for modifying the database at a very fine-...

The query routines offered by L<DBIx::Mint::ResultSet> use the 'fixup' mode while retrieving the statement holder with the SELECT query already prepared, but not while extracting information in the execution phase. If you fear that the database conne...

=head1 DEPENDENCIES

 view all matches for this distribution


DBIx-Poggy

 view release on metacpan or  search on metacpan

lib/DBIx/Poggy.pm  view on Meta::CPAN


        $dbh = shift @{ $self->{free} };
        my $used = delete $self->{last_used}{ refaddr $dbh };
        if ( (time - $used) > $self->{ping_on_take} ) {
            unless ( $dbh->ping ) {
                warn "connection is not alive, dropping";
                next;
            }
        }
        last;
    }

 view all matches for this distribution


DBIx-QueryLog

 view release on metacpan or  search on metacpan

lib/DBIx/QueryLog.pm  view on Meta::CPAN

  # ... do something
  DBIx::QueryLog->disable;

=item ignore_trace

Returns a guard object and disables tracing while the object is alive.

  use DBIx::QueryLog;

  # enabled
  $dbh->do(...);

 view all matches for this distribution


DBIx-QuickDB

 view release on metacpan or  search on metacpan

lib/DBIx/QuickDB/Driver.pm  view on Meta::CPAN

            # holds both the error log and the watcher's launch log). The server
            # process's own stdout/stderr go to the watcher's log_file, not the
            # driver's error_log, so a server that died (or never launched)
            # before writing error_log leaves error_log showing only inherited
            # template history -- the real failure is in the launch log. Also
            # report whether the server pid is still alive: "not running" points
            # at a launch/early-exit failure, "alive" at a slow or hung startup.
            my $spid       = $watcher->server_pid;
            my $alive      = ($spid && kill(0, $spid)) ? "alive (pid $spid)" : "not running";
            my $error_log  = $self->read_error_log;
            my $launch_log = $self->_read_file($watcher->log_file);

            $watcher->eliminate();

            my $msg = "Timed out waiting for server to start after ${timeout}s; server process is $alive.";
            $msg .= "\n=== server launch log ===\n$launch_log" if length $launch_log;
            $msg .= "\n=== error log ===\n$error_log"          if length $error_log;
            confess $msg;
        }

 view all matches for this distribution


DBIx-QuickORM

 view release on metacpan or  search on metacpan

lib/DBIx/QuickORM/Manual/Caching.pm  view on Meta::CPAN

L<DBIx::QuickORM::Manual::Connections> for the connection lifecycle.

=head1 WEAK REFERENCES: NO LEAKS

Cached rows are held by B<weak> reference. The cache lets you reuse a row while
it is still alive somewhere in your program, but it does not keep rows alive on
its own. Once nothing else references a row, it is garbage collected and its
cache entry disappears. Loading many rows and then dropping them does not grow
the cache without bound.

A consequence: identity is only guaranteed for as long as you hold a reference.

 view all matches for this distribution


DBIx-Roles

 view release on metacpan or  search on metacpan

Roles/AutoReconnect.pm  view on Meta::CPAN

				unless $@;
			# restore context if calls are restarted	
			$self-> context( $context);	
		}
		if ( $self-> dbh-> ping) {
			# DB is alive, most probably that was not a DBI-related error 
			if ( $conninfo-> [3]-> {RaiseError}) {
				die $@;
			} else {
				warn $@ if 
					not (exists $conninfo->[3]->{PrintError}) # DBI defaults

 view all matches for this distribution


DBIx-Table-TestDataGenerator

 view release on metacpan or  search on metacpan

lib/DBIx/Table/TestDataGenerator.pm  view on Meta::CPAN

        my $max_tree_depth            = $args{max_tree_depth};
        my $min_children              = $args{min_children};
        my $min_roots                 = $args{min_roots};
        my $roots_have_null_parent_id = $args{roots_have_null_parent_id};
        my $csv_dir                   = $args{csv_dir};
        my $keep_connection_alive     = $args{keep_connection_alive};
        my $transaction_size          = $args{transaction_size};

        my $dumper = DBIxSchemaDumper->new(
            dsn                   => $self->dsn,
            user                  => $self->user,

lib/DBIx/Table/TestDataGenerator.pm  view on Meta::CPAN

                       $transaction_size
                    && $num_records_added % $transaction_size != 0
                )
                || !$transaction_size
              );
            Query->disconnect($dbh_out) unless $keep_connection_alive;
        };

        if ($@) {
            warn "Transaction aborted because $@";
            eval { $dbh->rollback };

lib/DBIx/Table/TestDataGenerator.pm  view on Meta::CPAN


=item * csv_dir

Optional path to a csv file which will contain the test data, no data will be written to the target database in this case. If not defined, changes are applied to the target database.

=item * keep_connection_alive

Optional parameter defining if the database handle dbh should still be connected after having created the test data, defaults to false. (For some install tests, we need to set it to true since we are using an in-memory database which would otherwise ...

=item * transaction_size

lib/DBIx/Table/TestDataGenerator.pm  view on Meta::CPAN


=head2 disconnect

Arguments: none

Allows to disconnect the connection to the target database in case keep_connection_alive was set to true before when calling create_testdata.

=head1 INSTALLATION AND CONFIGURATION

To install this module, run the following commands:

 view all matches for this distribution


DBIx-TempDB

 view release on metacpan or  search on metacpan

lib/DBIx/TempDB.pm  view on Meta::CPAN

  # database is cleaned up when test exit

=head1 DESCRIPTION

L<DBIx::TempDB> is a module which allows you to create a temporary database,
which only lives as long as your process is alive. This can be very
convenient when you want to run tests in parallel, without messing up the
state between tests.

This module currently support PostgreSQL, MySQL and SQLite by installing the optional
L<DBD::Pg>, L<DBD::mysql> and/or L<DBD::SQLite> modules.

 view all matches for this distribution


DBIx-TextIndex

 view release on metacpan or  search on metacpan

testdata/encantadas.txt  view on Meta::CPAN

From a broken, stairlike base, washed as the steps of a water palace by the
waves, the tower rose in entablatures of strata to a shaven summit. These
uniform layers, which compose the mass, form its most peculiar feature. For
at their lines of junction they project flatly into encircling shelves,
from top to bottom, rising one above another in graduated series. And as
the eaves of any old barn or abbey are alive with swallows, so were all
these rocky ledges with unnumbered seafowl. Eaves upon eaves, and nests
upon nests. Here and there were long birdlime streaks of a ghostly white
staining the tower from sea to air, readily accounting for its saillike
look afar. All would have been bewitchingly quiescent were it not for the
demoniac din created by the birds. Not only were the eaves rustling with

 view all matches for this distribution


DBIx-TextSearch

 view release on metacpan or  search on metacpan

lib/DBIx/TextSearch.pm  view on Meta::CPAN


    $self->say("is file newer than already indexed version?\n");
    if ($ftype eq 'http') {
	$self->say("checking md5 sum with http\n");
	my $ua = LWP::UserAgent->new(env_proxy => 1,
				     keep_alive => 1,
				     timeout => 30);
	my $response = $ua->get($loc);
	cluck "Error while getting ", $response->request->uri,
	  " -- ", $response->status_line, "\nAborting"
	    unless $response->is_success;

 view all matches for this distribution


( run in 1.667 second using v1.01-cache-2.11-cpan-df04353d9ac )