Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0-BETA2
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:None
-
Environment:Mac OS X 10.6; PHP 5.3.2; MySQL 5.1.44
Description
When changing data in an entity, the UnitOfWork will call computeChangeSet on a flush event. If there is a changeset, the original data ($this->_originalEntityData) gets overridden by the new data. However, the _originalEntityData should hold the original data, that was present at the time the entity was reconstituted from the database. This does no longer hold now.
I think this can simply be fixed by commenting this line, however I do not know of any consequences this may bring with it:
$this->_originalEntityData[$oid] = $actualData; (in computeChangeSet, after if( $changeSet ));
Anyway, I ran into this problem while trying to retrieve the original data at the onFlush event of an update.
Activity
Jasper Kuperus
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
When changing data in an entity, the UnitOfWork will call computeChangeSet on a flush event. Here, if there is a changeset, the original data ($this->_originalEntityData) gets overridden by the new data. However, the _originalEntityData should hold the original data, that was present at the time the entity was reconstituted from the database. This does no longer hold now. I think this can simply be fixed by commenting this row, however I do not know of any consequences this may bring with it: $this->_originalEntityData[$oid] = $actualData; (in computeChangeSet, after if( $changeSet )); Anyway, I ran into this problem while trying to retrieve the original data at the onFlush event of an update. |
When changing data in an entity, the UnitOfWork will call computeChangeSet on a flush event. If there is a changeset, the original data ($this->_originalEntityData) gets overridden by the new data. However, the _originalEntityData should hold the original data, that was present at the time the entity was reconstituted from the database. This does no longer hold now. I think this can simply be fixed by commenting this line, however I do not know of any consequences this may bring with it: $this->_originalEntityData[$oid] = $actualData; (in computeChangeSet, after if( $changeSet )); Anyway, I ran into this problem while trying to retrieve the original data at the onFlush event of an update. |
Benjamin Eberlei
made changes -
| Issue Type | Bug [ 1 ] | Improvement [ 4 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 11618 ] | jira-feedback [ 13863 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 13863 ] | jira-feedback2 [ 15727 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 15727 ] | jira-feedback3 [ 17984 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-688, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
This is actually currently expected. You can not get access to the original data in the onFlush event right now. I'm not saying that this will never be possible but it is simply the way it works at the moment.