Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

DBIx::Connector timeout?

by Anonymous Monk
on Aug 01, 2013 at 22:53 UTC ( #1047511=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does DBIx::Connector have a limited number of times or limited length of times it tries to connect?

Replies are listed 'Best First'.
Re: DBIx::Connector timeout?
by kcott (Chancellor) on Aug 02, 2013 at 06:19 UTC

    While the short answer to this is no, I get the impression (based on the wording of your question) that there's some underlying assumption you're making that may be wrong. If you have code like:


    DBIx::Connector may need to reconnect. It doesn't keep a count of how many times it's encountered this situation nor does it keep track of how long it's spent doing this. You won't get an error saying something like: "Sorry, that's the nth time I've encountered run() and needed to reconnect so I won't be trying on this or any subsequent occasions."

    DBIx::Connector uses DBI's connect() method with the same arguments you pass to new(), i.e.

    DBIx::Connector->new($dsn, $username, $password, { %attributes })

    So, if you're familiar with DBI, the actual process of connecting is the same as you're used to.

    See Connection Modes, in the DBIx::Connector documentation, for information on when connection checks are made and how reconnecting (and possibly code re-execution) is handled.

    -- Ken

Re^2: DBIx::Connector timeout?
by leuchuk (Novice) on Aug 02, 2013 at 13:20 UTC

    The timeout comes most probable from the database.

    Every database has a predefined timeout. Usually on the clients side there is a parameter for the time wainting for an answer from the server.

    There are some solutions for your problem:

    First try whether your database is the one giving you this problem. It could be a timeout for example from IP or a wrong routing when e.g. the firewall interrups the traffic.

    Then check whether your connection parameters are right. A wrong port number could give you the head ache.

    If you identify the database as the one making the timeout: Rise the connection timeout in your database. There is usually an entry in a configuration file or depending on database and OS an environment variable. Rise the limit of open connections if it is a problem of too many open (and probably in parts idle) connections. If you have lots of users try pooling.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1047511]
Approved by kcott
Front-paged by derby
[hippo]: That was around April 1994. Fun times.
[hippo]: They had purchased some shiny new 486 DXs the year before but crippled them by installing Win 3.1. I demo'd Linux with X on them to the department head and got the go-ahead to wipe Windows and install the new hotness.
[marto]: glory days ;)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2018-06-22 09:54 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.