Issue while trying to insert data in EZP from XML

Author Message

Jeremy B.

Monday 05 May 2008 5:10:12 am

Hi there,

I'm having trouble with a PHP script that used to work for around 6 months.
I'm using EZP 3.9.2.

This cronjob reads XML file, and puts its content in the database.
For injecting content to my new object/updated object, i'm using many lines like :

$contentObjectAttributes['title']->setAttribute( 'data_text', $title );
$contentObjectAttributes['title']->store();

It all works correctly, but when i'm trying to publish my new object with :

include_once('lib/ezutils/classes/ezoperationhandler.php');
$operationResult = eZOperationHandler::execute('content', 'publish', array( 'object_id' => $object->attribute( 'id' ), 'version' => $object->attribute('current_version' ) ) ); 

i am having a <i>"Fatal error: A database transaction in eZ publish failed."</i>

Does someone had the same problem ? Can someone help me ?
Does this error has nothing to do with SQL mode STRICT_TRANS_TABLE ?

Many thanks in advance.

Piotrek Karaƛ

Monday 05 May 2008 11:39:17 am

This is just a pure guess, cause I have never touched that part directly, but maybe this would be a hint. This transaction error seems like a common message also for situations, when you try to carry out an operation that would clearly violate database rules, for example reinsert the same value for a primary key or a unique key. Now, looking at your example, this could be happening (knowing that publication should always create a new version)... I would inspect all the operations to see what is happening, and compare that to the db table state...

include_once('lib/ezutils/classes/ezoperationhandler.php');
$operationResult = eZOperationHandler::execute('content', 'publish', array( 'object_id' => $object->attribute( 'id' ), 'version' => $object->attribute('current_version' ) ) ); 

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Jeremy B.

Monday 05 May 2008 3:28:49 pm

Thanks for your response Piotrek.

In fact, this was a misconfiguration in my site.ini file. Someone turned on "transactions" for SQL queries.

The entiere site work well, but the cronjob wasn't. I don't really understand why.

I'm done with it now =)

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 18 2025 18:41:00
Script start
Timing: Jan 18 2025 18:41:00
Module start 'layout'
Timing: Jan 18 2025 18:41:00
Module start 'content'
Timing: Jan 18 2025 18:41:01
Module end 'content'
Timing: Jan 18 2025 18:41:01
Script end

Main resources:

Total runtime1.1493 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.0469152.6406
Module start 'layout' 0.00520.0030 740.687539.4922
Module start 'content' 0.00811.1395 780.1797550.7109
Module end 'content' 1.14770.0016 1,330.890612.1250
Script end 1.1492  1,343.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3106160.0002
Check MTime0.00130.1136160.0001
Mysql Total
Database connection0.00060.051310.0006
Mysqli_queries1.093595.1486570.0192
Looping result0.00080.0735550.0000
Template Total1.109796.620.5549
Template load0.00210.180820.0010
Template processing1.107696.376920.5538
Template load and register function0.00010.012510.0001
states
state_id_array0.00150.126410.0015
state_identifier_array0.00240.209420.0012
Override
Cache load0.00170.1497260.0001
Sytem overhead
Fetch class attribute can translate value0.00080.072620.0004
Fetch class attribute name0.00100.082750.0002
XML
Image XML parsing0.00270.232820.0013
class_abstraction
Instantiating content class attribute0.00000.000760.0000
General
dbfile0.00380.3300230.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/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: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs