HOWTO SQL? Can't execute ... locked tables....

Author Message

Björn Dieding@xrow.de

Friday 30 June 2006 5:40:08 am

Query error: Can't execute the given command because you have active locked tables or an active transaction. Query: TRUNCATE ezcollab_group

The following code produces the error in my system.

        $db =& eZDB::instance();
        $db->begin();
	    $db->query( "UNLOCK TABLES" );
        $db->query( "TRUNCATE ezapprove_items" );
        $db->query( "TRUNCATE ezcollab_group" );
        $db->query( "TRUNCATE ezcollab_item" );
        $db->query( "TRUNCATE ezcollab_item_group_link" );
        $db->query( "TRUNCATE ezcollab_item_message_link" );
        $db->query( "TRUNCATE ezcollab_item_participant_link" );
        $db->query( "TRUNCATE ezcollab_item_status" );
        $db->query( "TRUNCATE ezcollab_profile" );
        $db->query( "TRUNCATE ezcollab_simple_message" );
        $db->query( "TRUNCATE ezworkflow_process" );
        
        $list = eZContentObjectVersion::fetchObjectList( eZContentObjectVersion::definition(), null,  array( 'status' => EZ_VERSION_STATUS_PENDING ) );

        if ( count( $list ) > 0 )
        {
            foreach( $list as $item )
            {
                $assignments = $item->nodeAssignments();
                foreach ( $assignments as $assignment )
                {
                    $assignment->remove();
                }
                $item->remove();
            }
        }

        $db->commit();

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 21 2025 04:29:59
Script start
Timing: Jan 21 2025 04:29:59
Module start 'layout'
Timing: Jan 21 2025 04:29:59
Module start 'content'
Timing: Jan 21 2025 04:30:01
Module end 'content'
Timing: Jan 21 2025 04:30:01
Script end

Main resources:

Total runtime1.1041 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 589.2969151.2109
Module start 'layout' 0.00750.0029 740.507836.6484
Module start 'content' 0.01041.0928 777.1563494.0234
Module end 'content' 1.10320.0008 1,271.17977.8281
Script end 1.1040  1,279.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3213160.0002
Check MTime0.00150.1314160.0001
Mysql Total
Database connection0.00170.150510.0017
Mysqli_queries1.059295.9328460.0230
Looping result0.00050.0456440.0000
Template Total1.059996.020.5300
Template load0.00270.241720.0013
Template processing1.057395.758820.5286
Template load and register function0.00010.010010.0001
states
state_id_array0.00200.179110.0020
state_identifier_array0.00310.285120.0016
Override
Cache load0.00190.169570.0003
Sytem overhead
Fetch class attribute can translate value0.00130.115110.0013
Fetch class attribute name0.00080.075420.0004
XML
Image XML parsing0.00070.065810.0007
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00320.2917160.0002
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs