Forums / Developer / Issue while trying to insert data in EZP from XML

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 =)

eZ debug

Timing: Jan 31 2025 00:40:23
Script start
Timing: Jan 31 2025 00:40:23
Module start 'content'
Timing: Jan 31 2025 00:40:23
Module end 'content'
Timing: Jan 31 2025 00:40:23
Script end

Main resources:

Total runtime0.2237 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.0781370.2734
Module start 'content' 0.00660.0142 958.35161,005.7031
Module end 'content' 0.02080.2028 1,964.05473,895.0391
Script end 0.2237  5,859.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00451.9943200.0002
Check MTime0.00140.6262200.0001
Mysql Total
Database connection0.00060.249510.0006
Mysqli_queries0.135460.51561410.0010
Looping result0.00120.52101390.0000
Template Total0.202590.510.2025
Template load0.00080.346510.0008
Template processing0.201790.150310.2017
Override
Cache load0.00050.239110.0005
Sytem overhead
Fetch class attribute can translate value0.00180.788010.0018
XML
Image XML parsing0.00020.104510.0002
General
dbfile0.00843.7394200.0004
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs