Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0-ALPHA4
-
Fix Version/s: 2.0-ALPHA4
-
Component/s: ORM
-
Security Level: All
-
Labels:None
Description
This problem will be difficult to reproduce for you, but I isolated the exact cause of it.
To reproduce
- Use any MetadataCache
- Create a complex entity with some inheritance. (I may detail in later if your really need it)
- Create an element of this entity with persist.
- Create an other element of this entity but not on the same php run. (ex: reload the page)
- The insert statement will fail because field names will not match parameters.
I narrowed it down to a serialization issue.
When you serialize an MetadataInfo, you don't serialize reflFields.
When you unserizlize you regenerate this value using ReflectionClass
That sound's like a good optimization.
The problem is that somehow, the reflection class can return the fields not in the same order that they were at the initial creation of the MetadataInfo.
Because the insertSql value is not re-generated, it can be out of sync with the new fields order.
The solution :
Call something like MetadataInfoFactory::_generateStaticSql (whish is private but ...) at wakeup time.
Activity
Roman S. Borschel
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 2.0-ALPHA4 [ 10036 ] |
Roman S. Borschel
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Roman S. Borschel
made changes -
| Status | In Progress [ 3 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 10483 ] | jira-feedback [ 15490 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 15490 ] | jira-feedback2 [ 17354 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 17354 ] | jira-feedback3 [ 19611 ] |
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-168, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Are you using composite keys anywhere?
The fact that reflFields is not serialized is not really an optimization but rather due to the fact that they simply can can not be serialized/unserialized properly.
We surely need some more concrete test case in order to reproduce this.