FAQ
I'm helping a co-worker debug some code, and I can't figure out
what is going on. I hope someone can shed some light on it.

This is perl, version 5.005_02 built for alpha-dec_osf
DBI 1.14
Msql-Mysql-modules-1.2217.tar.gz


Basically, He calls a subroutine that evals the execute
and checks $@. He keeps rerunning in debugger so there
are duplicate keys that were already inserted. So he uses
the eval to skip those errors. It actuall quits in multiple
subroutines. I commented out the eval in one subroutine and
added $dbh->{RaiseError} = 0, and it did not quit in this sub,
but it did quit in another sub with,

main::update_newcust(qwl_newcust.pl:430):
430: if ($@) {
100 levels deep in subroutine calls!

Anybody know what I am missing here???

----------------------------------
E-Mail: Scott T. Hildreth <shildreth@emsphone.com>
Date: 15-Jun-01
Time: 13:33:13
----------------------------------

Search Discussions

  • Sterin, Ilya at Jun 15, 2001 at 7:07 pm
    Well depending on why it is failing. You error message does not provide any
    help. Try using $DBI::errstr in it and also use trace() at level 2 (see
    docs). You can then submit both to us if you can't figure out yourself.

    Ilya

    -----Original Message-----
    From: Scott T. Hildreth
    To: dbi-users@perl.org
    Sent: 06/15/2001 12:50 PM
    Subject: 100 levels deep in subroutine calls!


    I'm helping a co-worker debug some code, and I can't figure out
    what is going on. I hope someone can shed some light on it.

    This is perl, version 5.005_02 built for alpha-dec_osf
    DBI 1.14
    Msql-Mysql-modules-1.2217.tar.gz


    Basically, He calls a subroutine that evals the execute
    and checks $@. He keeps rerunning in debugger so there
    are duplicate keys that were already inserted. So he uses
    the eval to skip those errors. It actuall quits in multiple
    subroutines. I commented out the eval in one subroutine and
    added $dbh->{RaiseError} = 0, and it did not quit in this sub,
    but it did quit in another sub with,

    main::update_newcust(qwl_newcust.pl:430):
    430: if ($@) {
    100 levels deep in subroutine calls!

    Anybody know what I am missing here???

    ----------------------------------
    E-Mail: Scott T. Hildreth <shildreth@emsphone.com>
    Date: 15-Jun-01
    Time: 13:33:13
    ----------------------------------
  • Scott T. Hildreth at Jun 15, 2001 at 7:19 pm
    Sorry I should have mentioned that I did Trace it,

    I traced one of the Statement Handles as well as the
    Db Handle, it shows the Duplicate Error being returned
    but nothing else,

    ERROR EVENT 5 'Duplicate entry '2067258104' for key 1' on
    DBI::st=HASH(0x14037fa50)
    Duplicate entry '2067258104' for key 1 error 5 recorded: Duplicate entry
    '2067258104' for key 1
    <- dbd_st_execute -2 rows
    !! ERROR: 5 'Duplicate entry '2067258104' for key 1'
    <- execute= undef at qwl_newcust.pl line 374.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x14037fa50)~INNER)
    <- DESTROY= undef during global destruction.

    ..the dups are there, that is why we catch with a eval.

    The $dbh trace shows the same thing,

    Duplicate entry '2084592512' for key 1 error 5 recorded: Duplicate entry
    '2084592512' for key 1
    <- dbd_st_execute -2 rows
    !! ERROR: 5 'Duplicate entry '2084592512' for key 1'
    <- execute= undef at qwl_newcust.pl line 424.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x14035fa90)~INNER)
    <- DESTROY= undef during global destruction.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x140379b00)~INNER)
    <- DESTROY= undef during global destruction.
    -> DESTROY for DBD::mysql::db (DBI::db=HASH(0x14035fa30)~INNER)
    Rollback ineffective while AutoCommit is on error 15 recorded: Rollback
    ineffective while AutoCommit is on
    imp_dbh->svsock: 14030e350
    <- DESTROY= undef during global destruction.

    ..I don't think it is DBI, because the Trace coninue to show the dup
    errors for each record, then they call the DESTROY, and the other
    error(100 levels deep in subroutine calls!) comes up.

    On 15-Jun-01 Sterin, Ilya wrote:
    Well depending on why it is failing. You error message does not provide any
    help. Try using $DBI::errstr in it and also use trace() at level 2 (see
    docs). You can then submit both to us if you can't figure out yourself.

    Ilya

    -----Original Message-----
    From: Scott T. Hildreth
    To: dbi-users@perl.org
    Sent: 06/15/2001 12:50 PM
    Subject: 100 levels deep in subroutine calls!


    I'm helping a co-worker debug some code, and I can't figure out
    what is going on. I hope someone can shed some light on it.

    This is perl, version 5.005_02 built for alpha-dec_osf
    DBI 1.14
    Msql-Mysql-modules-1.2217.tar.gz


    Basically, He calls a subroutine that evals the execute
    and checks $@. He keeps rerunning in debugger so there
    are duplicate keys that were already inserted. So he uses
    the eval to skip those errors. It actuall quits in multiple
    subroutines. I commented out the eval in one subroutine and
    added $dbh->{RaiseError} = 0, and it did not quit in this sub,
    but it did quit in another sub with,

    main::update_newcust(qwl_newcust.pl:430):
    430: if ($@) {
    100 levels deep in subroutine calls!

    Anybody know what I am missing here???

    ----------------------------------
    E-Mail: Scott T. Hildreth <shildreth@emsphone.com>
    Date: 15-Jun-01
    Time: 13:33:13
    ----------------------------------
    ----------------------------------
    E-Mail: Scott T. Hildreth <shildreth@emsphone.com>
    Date: 15-Jun-01
    Time: 14:12:07
    ----------------------------------
  • Mike<mickalo>Blezien at Jun 15, 2001 at 7:26 pm
    On Fri, 15 Jun 2001 14:20:28 -0500 (CDT), "Scott T. Hildreth" wrote:
    It appears that you are attempting to enter data to a column that has possible
    reached it's max size. What type of column type is the duplicate entry referring
    too??
    Sorry I should have mentioned that I did Trace it,

    I traced one of the Statement Handles as well as the
    Db Handle, it shows the Duplicate Error being returned
    but nothing else,

    ERROR EVENT 5 'Duplicate entry '2067258104' for key 1' on
    DBI::st=HASH(0x14037fa50)
    Duplicate entry '2067258104' for key 1 error 5 recorded: Duplicate entry
    '2067258104' for key 1
    <- dbd_st_execute -2 rows
    !! ERROR: 5 'Duplicate entry '2067258104' for key 1'
    <- execute= undef at qwl_newcust.pl line 374.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x14037fa50)~INNER)
    <- DESTROY= undef during global destruction.

    ..the dups are there, that is why we catch with a eval.

    The $dbh trace shows the same thing,
    Mike(mickalo)Blezien
    ========================================
    Thunder Rain Internet Publishing
    Providing Internet Solutions that work!
    http://www.thunder-rain.com
    Tel: 1(225) 686-2002
    =========================================
  • Mitch Helle-Morrissey at Jun 15, 2001 at 7:33 pm
    This is kind of a cop out, but I think you'd be better off fixing your
    database to match what your program expects than to change your program to
    deal with incomplete data in the database. Or you could just check if
    things exist before inserting them. I think you are getting into some messy
    stuff with recursion and eval that you could avoid. I'd be really
    suspicious of the subroutine that this is happening in. It doesn't call
    itself, does it?

    Mitch
    -----Original Message-----
    From: shildret@scotth.emsphone.com
    On Behalf Of Scott T. Hildreth
    Sent: Friday, June 15, 2001 2:20 PM
    To: Sterin, Ilya
    Cc: dbi-users@perl.org
    Subject: RE: 100 levels deep in subroutine calls!


    Sorry I should have mentioned that I did Trace it,

    I traced one of the Statement Handles as well as the
    Db Handle, it shows the Duplicate Error being returned
    but nothing else,

    ERROR EVENT 5 'Duplicate entry '2067258104' for key 1' on
    DBI::st=HASH(0x14037fa50)
    Duplicate entry '2067258104' for key 1 error 5 recorded:
    Duplicate entry
    '2067258104' for key 1
    <- dbd_st_execute -2 rows
    !! ERROR: 5 'Duplicate entry '2067258104' for key 1'
    <- execute= undef at qwl_newcust.pl line 374.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x14037fa50)~INNER)
    <- DESTROY= undef during global destruction.

    ..the dups are there, that is why we catch with a eval.

    The $dbh trace shows the same thing,

    Duplicate entry '2084592512' for key 1 error 5 recorded:
    Duplicate entry
    '2084592512' for key 1
    <- dbd_st_execute -2 rows
    !! ERROR: 5 'Duplicate entry '2084592512' for key 1'
    <- execute= undef at qwl_newcust.pl line 424.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x14035fa90)~INNER)
    <- DESTROY= undef during global destruction.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x140379b00)~INNER)
    <- DESTROY= undef during global destruction.
    -> DESTROY for DBD::mysql::db (DBI::db=HASH(0x14035fa30)~INNER)
    Rollback ineffective while AutoCommit is on error 15
    recorded: Rollback
    ineffective while AutoCommit is on
    imp_dbh->svsock: 14030e350
    <- DESTROY= undef during global destruction.

    ..I don't think it is DBI, because the Trace coninue to show the dup
    errors for each record, then they call the DESTROY, and the other
    error(100 levels deep in subroutine calls!) comes up.

    On 15-Jun-01 Sterin, Ilya wrote:
    Well depending on why it is failing. You error message
    does not provide any
    help. Try using $DBI::errstr in it and also use trace() at
    level 2 (see
    docs). You can then submit both to us if you can't figure
    out yourself.
    Ilya

    -----Original Message-----
    From: Scott T. Hildreth
    To: dbi-users@perl.org
    Sent: 06/15/2001 12:50 PM
    Subject: 100 levels deep in subroutine calls!


    I'm helping a co-worker debug some code, and I can't figure out
    what is going on. I hope someone can shed some light on it.

    This is perl, version 5.005_02 built for alpha-dec_osf
    DBI 1.14
    Msql-Mysql-modules-1.2217.tar.gz


    Basically, He calls a subroutine that evals the execute
    and checks $@. He keeps rerunning in debugger so there
    are duplicate keys that were already inserted. So he uses
    the eval to skip those errors. It actuall quits in multiple
    subroutines. I commented out the eval in one subroutine and
    added $dbh->{RaiseError} = 0, and it did not quit in this sub,
    but it did quit in another sub with,

    main::update_newcust(qwl_newcust.pl:430):
    430: if ($@) {
    100 levels deep in subroutine calls!

    Anybody know what I am missing here???

    ----------------------------------
    E-Mail: Scott T. Hildreth <shildreth@emsphone.com>
    Date: 15-Jun-01
    Time: 13:33:13
    ----------------------------------
    ----------------------------------
    E-Mail: Scott T. Hildreth <shildreth@emsphone.com>
    Date: 15-Jun-01
    Time: 14:12:07
    ----------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedJun 15, '01 at 6:48p
activeJun 15, '01 at 7:33p
posts5
users4
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase