Dear ez buddies,

the case problem with Oracle goes on. I have a oracle database. All 
database object are defined in Oracle default case, without any quoting, 
thus upper case.

I've defined a persistent object like:

---
<?php
$def = new ezcPersistentObjectDefinition();
$def->table = 'TAXON';
$def->class = 'R3PmTaxon';

$def->idProperty = new ezcPersistentObjectIdProperty();
$def->idProperty->columnName = 'TXN_ID';
$def->idProperty->propertyName = 'txn_id';
$def->idProperty->generator = new 
ezcPersistentGeneratorDefinition('ezcPersistentSequenceGenerator',
array('sequence' => R3Dbdc('taxon_txn_id_seq')));

$def->properties['txn_name_id'] = new ezcPersistentObjectProperty();
$def->properties['txn_name_id']->columnName = 'TXN_NAME_ID';
$def->properties['txn_name_id']->propertyName = 'txn_name_id';
$def->properties['txn_name_id']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_INT;
 ...

---

When trying to $session->load(), the whole thing blows up in 
ezc/PersistentObject/internal/state_transformer.php, line 57. Trying to 
diagnose what happens I would guess that the database $row in the 
function parameters has the keys turned to lower case because of the PDO 
settings in Database/handler.php, line 91: $this->setAttribute( 
PDO::ATTR_CASE, PDO::CASE_LOWER ), as should a print_r($row) in the 
function body:

---
Array
(
    [txn_id] => 2
    [txn_name_id] => 12

...
---
 and the persistent object definition goes like

----

ezcPersistentObjectDefinition Object
(
    [propertyArray:protected] => Array
...
            [properties] => ezcPersistentObjectProperties Object
                (
                    [txn_name_id] => ezcPersistentObjectProperty Object
                        (
                            [properties:private] => Array
                                (
                                    [columnName] => TXN_NAME_ID
                                    [propertyName] => txn_name_id
                                    [propertyType] => 2
                                    [converter] => 
                                    [databaseType] => 2
                                )

                        )

                    [txn_text_id] => ezcPersistentObjectProperty Object
                        (
                            [properties:private] => Array
                                (
                                    [columnName] => TXN_TEXT_ID
                                    [propertyName] => txn_text_id
                                    [propertyType] => 2
                                    [converter] => 
                                    [databaseType] => 2
                                )

                        )
...

            [columns] => ezcPersistentObjectColumns Object
                (
                    [TXN_NAME_ID] => ezcPersistentObjectProperty Object
                        (
                            [properties:private] => Array
                                (
                                    [columnName] => TXN_NAME_ID
                                    [propertyName] => txn_name_id
                                    [propertyType] => 2
                                    [converter] => 
                                    [databaseType] => 2
                                )

                        )

                    [TXN_TEXT_ID] => ezcPersistentObjectProperty Object
                        (
                            [properties:private] => Array
                                (
                                    [columnName] => TXN_TEXT_ID
                                    [propertyName] => txn_text_id
                                    [propertyType] => 2
                                    [converter] => 
                                    [databaseType] => 2
                                )

                        )
...
----



So when the loop in line 57 looks for a matching column for the given row key, 
it will not find it and throws a

<br /><b>Notice</b>: Undefined index:  txn_id in 
<b>/usr/share/pear/ezc/PersistentObject/internal/state_transformer.php</b> on 
line <b>57</b><br />
&lfloor; file <b>/data/devel/php/R3-PlantMap/sito/web/admin/edit.php</b> at 
line: <b>159</b> function: <b>load("R3PmTaxon", 2)</b><br />
&nbsp;&nbsp;&lfloor; file 
<b>/usr/share/pear/ezc/PersistentObject/persistent_session.php</b> at line: 
<b>69</b> function: <b>load("R3PmTaxon", 2)</b><br />
&nbsp;&nbsp;&nbsp;&nbsp;&lfloor; file 
<b>/usr/share/pear/ezc/PersistentObject/handlers/load_handler.php</b> at line: 
<b>41</b> function: <b>loadIntoObject(CLASS::R3PmTaxon, 2)</b><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lfloor; file 
<b>/usr/share/pear/ezc/PersistentObject/handlers/load_handler.php</b> at line: 
<b>123</b> function: <b>rowToStateArray(Array, 
CLASS::ezcPersistentObjectDefinition)</b><br />


Should this be filed as a bug?

Regards,

Peter


-- 
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: peter.hopfgart...@r3-gis.com
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com

-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to