I am running DBI version 1.616 along with DBD::Sybase version 1.12 to connect to the Sybase IQ 15.4 server through one of my Perl modules. The platform is IBM AIX 5.3.0.0 maintenance level 5300-12 The problem that I am facing is that one of my simple queries randomly hangs for no apparant reason. The query is to select some data from the system view SYS.SYSTABLE. The code runs fine as such but every once in a while the code (execute statement) freezes and appears to be doing noting for a long time and I have to terminate the process forcibly. Below is a fragment of code that I'm running (all variables are properly defined): AutoCommit is set to 1 RaiseError is set to 1
$dsn = "dbi:Sybase:serverType=IQ:loginTimeout=240:server=$db_server_if +c"; my $dbh = DBI->connect($dsn, $self->get_db_username(), $self->get_db_password(), \%connect_options ); my $sqlA =<< "END_SQLA"; SELECT table_id FROM sys.systable WHERE table_name like '${uc_table_name}%' AND length(table_name) = $table_name_len AND user_name(creator) = '$uc_schema' END_SQLA my $sthA = $dbh->prepare($sqlA); $sthA->execute();
Can someone help me figure out what might be wrong with the code or if any of the modules versions that I am using are incompatible with Sybase IQ 15.4. Another interesting thing to note is that the same code works fine most of the times, but the problem occurs randomly at random times. I have checked the active connections in my database when the code hangs, there are no deadlocks or blocked processes. I can also see that the connection to DB is being established successfully but I do not see any active executing statements at all for the DB handle.

In reply to DBD::Sybase query execute hangs randomly for Sybase IQ 15.4 by cmahajan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.