Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAMEDBD::Gofer::Transport::Base - base class for DBD::Gofer client transports
my $remote_dsn = "..." DBI->connect("dbi:Gofer:transport=...;url=...;timeout=...;retry_limit=...;dsn=$remote_dsn",...)
or, enable by setting the
which will force all
DESCRIPTIONThis is the base class for all DBD::Gofer client transports.
ATTRIBUTESGofer transport attributes can be specified either in the attributes parameter of the connect() method call, or in the
When used in the
go_timeoutA time limit for sending a request and receiving a response. Some drivers may implement sending and receiving as separate steps, in which case (currently) the timeout applies to each separately.
If a request needs to be resent then the timeout is restarted for each sending of a request and receiving of a response.
go_retry_limitThe maximum number of times an request may be retried. The default is 2.
go_retry_hookThis subroutine reference is called, if defined, for each response received where $response->err is true.
The subroutine is pass three parameters: the request object, the response object, and the transport object.
If it returns an undefined value then the default retry behaviour is used. See ``
If it returns a defined but false value then the request is not resent.
If it returns true value then the request is resent, so long as the number of retries does not exceed "go_retry_limit".
RETRY ON ERRORThe default retry on error behaviour is:
- Retry if the error was due to DBI_GOFER_RANDOM. See L<DBI::Gofer::Execute>. - Retry if $request->is_idempotent returns true. See L<DBI::Gofer::Request>.
A retry won't be allowed if the number of previous retries has reached "go_retry_limit".
TRACINGTracing of gofer requests and responses can be enabled by setting the "DBD_GOFER_TRACE" environment variable. A value of 1 gives a reasonably compact summary of each request and response. A value of 2 or more gives a detailed, and voluminous, dump.
The trace is written using
METHODSThis section is currently far from complete.
$retry = $transport->response_retry_preference($request, $response);
The response_retry_preference is called by DBD::Gofer when considering if a request should be retried after an error.
Returns true (would like to retry), false (must not retry), undef (no preference).
If a true value is returned in the form of a
AUTHORTim Bunce, <www.tim.bunce.name>
LICENCE AND COPYRIGHTCopyright (c) 2007-2008, Tim Bunce, Ireland. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
SEE ALSODBD::Gofer, DBI::Gofer::Request, DBI::Gofer::Response, DBI::Gofer::Execute.
and some example transports: