Forums / Developer / SQL queries break Content Object creation

SQL queries break Content Object creation

Author Message

Dave Dykshoorn

Wednesday 24 September 2003 8:54:35 am

The problem I am facing is one that I can't make much sense out of and I was hoping someone could enlighten me to my mistake. The Query works and returns the correct results however if I run the query
$class =& eZContentClass::fetch(19);
returns this:

ezcontentclass Object
(
[PersistentDataDirty] =>
[ID] =>
[Name] =>
[Identifier] =>
[ContentObjectName] =>
[Version] =>
[VersionCount] => 1
[CreatorID] =>
[ModifierID] =>
[Created] =>
[Modified] =>
[InGroups] =>
[AllGroups] =>
)

whereas if i fake, or remove, the query it creates the object correctly:

ezcontentclass Object
(
[PersistentDataDirty] =>
[ID] => 19
[Name] => Saved Report
[Identifier] => saved_report
[ContentObjectName] =>
[Version] => 0
[VersionCount] => 1
[CreatorID] => 14
[ModifierID] => 14
[Created] => 1059166776
[Modified] => 1064251143
[InGroups] =>
[AllGroups] =>
)

I attempted the query using the built in php mysql functions with the same result. I have also moved the query to after fetching the class but this doesn't help either.

The code follows:

$db =& new eZMySQLDB(array( 'server'=>'myserver',
'database'=>'mydatabase',
'user'=>'dbuser',
'password'=>'userspassword' ) );

$info = $db->arrayQuery("SELECT `Report`, `RunName`, `UserID` FROM `mytable` WHERE `RunID` = $RunID" );

$class =& eZContentClass::fetch(19); //my content class

...
(more code)

Thanks for the help!

Dave

Dave Dykshoorn

Wednesday 24 September 2003 3:03:19 pm

The problem is more generic than I first thought. If I connect to a db other than the ezp db any and all eZp Object functions seem to return defined but empty objects.

I think there is a problem with the way I terminate my db connection (or don't terminate it). It seems eZp is getting confused with the mysql resource that I create by connecting to another db. eZp seems to be unable to accurately get information about eZp objects.

Again, if I remove the query everything runs fine. If I do my queries in another view and then $Module->redirectToView the results of the query, the objects (after the redirect) work fine as well.

Has anyone else run into this? Or does anyone know if I'm running the above query incorrectly, which could cause eZp's db connection to get messed up?

Dave

enigmista enigmista

Tuesday 27 July 2004 6:04:00 am

Same problem. No solution found.

eZ debug

Timing: Jan 30 2025 21:18:56
Script start
Timing: Jan 30 2025 21:18:56
Module start 'content'
Timing: Jan 30 2025 21:18:56
Module end 'content'
Timing: Jan 30 2025 21:18:56
Script end

Main resources:

Total runtime0.2260 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.0069 588.0625370.2734
Module start 'content' 0.00690.0138 958.33591,001.4688
Module end 'content' 0.02070.2052 1,959.80473,897.0391
Script end 0.2259  5,856.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00441.9575200.0002
Check MTime0.00130.5784200.0001
Mysql Total
Database connection0.00060.253510.0006
Mysqli_queries0.131358.09751410.0009
Looping result0.00130.58941390.0000
Template Total0.204890.610.2048
Template load0.00080.366010.0008
Template processing0.204090.259510.2040
Override
Cache load0.00060.260710.0006
Sytem overhead
Fetch class attribute can translate value0.00200.896510.0020
XML
Image XML parsing0.00020.090710.0002
General
dbfile0.01024.5325200.0005
String conversion0.00000.002230.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