[DC-371] Lazy loading - doctrine makes extra queries into db Created: 19/Dec/09 Updated: 23/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors, Documentation, Query, Record |
| Affects Version/s: | 1.2.0-BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Roman Drapeko | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symfony 1.4, Doctrine Version: 1.2.0-BETA3 |
||
| Description |
|
Just downloaded symfony 1.4 First of all I have a query: $q = \Doctrine_Query::create() After that I'm accessing the fields of this object: $userArray = array( This is the actual queries into DB: NR1: NR2: As you can see there are TWO queries however there should be only one query. The problem is that u.user_real_id is NULL in database and when I do 'real_user_details_id' => $this->getUser()->getRealUserDetailsId() doctrine does not have enough intelligence to understand that these fields have been already requested in NR1. If I comment this field, everything works well. SURPRISE! As you understand this a very critical bug and of course our system won't go to production with this bug. P.S. Is it possible to turn off the lazy loading in doctrine? |
| Comments |
| Comment by Roman Drapeko [ 17/Jan/10 ] |
|
Any comments? Will it be fixed?? |
| Comment by Jonathan H. Wage [ 01/Mar/10 ] |
|
Hi, I'd like to take a look but can you make a failing test case that I can run so that I can see if I can come up with a patch that fixes your case and doesn't break anything else. |
| Comment by Luke Winiarski [ 01/Jun/10 ] |
|
Hi I had similar problem but after several hours i did work it out Try to make get method in your model for getting field which has NULL value in database public function getUserRealId() { return $this->_get("user_real_id", false); }by making second argument false u force doctrine not to lazy load value and extra sql query is not created regards |
| Comment by Jonathan H. Wage [ 08/Jun/10 ] |
|
Has anyone been able to reproduce this in a test case? I am not having much luck so far. |
| Comment by Gennady Feldman [ 23/Dec/10 ] |
|
I've seen this a ton of times. Basically when it loads related records through the Hydrator using leftJoin() and gets NULLs back. BUT it doesn't save the fact that the related records are NULL. So when you actually do call to getRelated objects it sees that it doesn't have the value cached and runs the query again. Let me know if I should show you the problem in the Doctrine code base. |
[DC-862] INNER JOIN example is same as previous LEFT JOIN example Created: 08/Sep/10 Updated: 08/Sep/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Roberto Mansfield | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: | |||
| Description |
|
I was reading the "JOIN syntax" section of the documentation. The docs first talk about how the default join type is LEFT JOIN and an example is presented. Next, INNER JOINS are discussed, but the example is the same left join example used previously. Am I misunderstanding the flow of the document? |
Non-Equal Nest Relations Not Working - from "Children" side
(DC-952)
|
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors, Documentation, Nested Set, Relations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Sub-task | Priority: | Major |
| Reporter: | Daniel Reiche | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3 / symfony 1.4.9 |
||
| Description |
|
Sorry for the lengthy explanation, couldn't make it more straight forward: I have a model which is similiar to a nestet set but the tree structure needs to overlap: For Model A, every Object A1 can have multiple descendant objects A2 and in turn can be a descendant of multiple objects A0. Since I saw no way to do this with Nested-Set Relations (or Equal-Nested-Sets) I have set up my Model like this: modules: modules_required: I needed to specify the Relations on both tables, to use onDelete/onUpdate CASCADE rules. Generated Models look fine, just as intended. Now the strange part: The point is: Is there a better way to solve my problem? |
| Comments |
| Comment by Daniel Reiche [ 25/Jan/11 ] |
|
forgot to add something: I have done a debug run, to see why these queries are created, when there was no data modified that related to these tables: Doctrine seems to handle my structure internally as a Nested-Set, although I have not specified an actAs: NestedSet or relations: equal: true statement in the model definition. This is not a nested set, as each object can have virtually any other object either as parent or as a child, and additionaly, parent relations can span multiple tree-levels: results in: Object 6 has parents 2 and 4 (where 4 has parent 3 and 3 has parent 2 in turn) This spanning relations seems to cause the guessed nested set to fail. I simply wanted to create an m:n Relation using a Reference table and the fact that both m and n are of the same class should not consider doctrine. |
| Comment by Daniel Reiche [ 26/Jan/11 ] |
|
related to #DC-329: also the h2aEqualable mentioned there does not work, because it does not prevent symfony from issueing the delete queries. It prevents only the UPDATE-Queries, and thus circumvents the MySQL-Error. Nevertheless, data is still corrupted after object save, thus not useable in production. |
[DC-379] No description of ATTR_DEFAULT_IDENTIFIER_OPTIONS now in "Chapter 4 Configuration" Created: 23/Dec/09 Updated: 23/Dec/09 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | zerkms | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In the previous (1.1) documentation version there were small but useful description about how to set up primary key (http://www.doctrine-project.org/documentation/manual/1_1/en/configuration#defaults-attributes:default-added-auto-id) ps: message "If you find a problem with the documentation or have a suggestion, please register and open a ticket. " in the bottom of the docs pages is ambiguous due to it points to trac :-$ |
[DC-348] Doctrine manual does not document that columns can be added with simple inheritance, or the semantics of accessing those columns in the parent Created: 10/Dec/09 Updated: 10/Dec/09 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Tom Boutell | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The Doctrine manual's section on inheritance mentions simple inheritance only briefly. The examples do not show that columns can be added, nor do they explain that the parent model class can also access those columns (very useful when you override its methods at the application level in Symfony). Both behaviors are supported (Jon suggested I take advantage of them at one point) but it's easy to miss the fact that they are available. For a long time I assumed column aggregation inheritance was the only way to add columns. I'm now exploiting simple inheritance as a way to add columns to sfGuardUser rather than introducing an sfGuardUserProfile class with all of the attendant problems of trying to pretend two tables are actually one table. This is very useful. (Out of curiosity, is there an alternative way to add columns to plugin schemas at the app level in Symfony 1.3 similar to the way it's now done for Propel?) |
[DC-339] Documentation unclear about linking inherited objects Created: 08/Dec/09 Updated: 08/Dec/09 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.1 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Tarjei Huse | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The (very nice) doctrine documentation fails to mention anything about how inherited objects handle relations. I.e. if I got the model: User: Group: Topic: Can I then define both users and groups to link to Topic? |
[DC-631] Documentation Created: 15/Apr/10 Updated: 15/Apr/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Thomas Tourlourat - Armetiz | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
http://www.doctrine-project.org/Doctrine_Record/1_2#method_importfrom The description of the $type parameter is : Format type: xml, yml, json So the documentation have to be update for this point. |
[DC-501] Join and WITH keywords : documentation is confusing Created: 15/Feb/10 Updated: 15/Feb/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.1.6 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Julien B. | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Your documentation makes no sense to me on the usage of the WITH keyword $q = Doctrine_Query::create()
->select('u.id, p.id')
->from('User u')
->leftJoin('u.Phonenumbers p WITH u.id = 2');
Get Users and the phone numbers if any of the user 2 (we could indeed need that kind of query) ----------------------------------------------------------------------------------------------------------------------------------- // Documentation $q = Doctrine_Query::create()
->select('u.id, p.id')
->from('User u')
->leftJoin('u.Phonenumbers p WITH p.type = ?', 'mobile');
you can expect this SQL SELECT u.id AS u__id, p.id AS p__id FROM User u LEFT JOIN Phonenumbers p ON u.id = p.user_id AND p.type = 'mobile' // Still in the documentation $q = Doctrine_Query::create()
->select('u.id, p.id')
->from('User u')
->leftJoin('u.Phonenumbers p')
->where('p.type = ?', 'mobile')
;
because you will strip away the users who do not have a mobile phone number ----------------- $q = Doctrine_Query::create()
->select('u.id')
->from('User u')
->leftJoin('u.Groups g')
->innerJoin('u.Phonenumbers p WITH u.id > 3')
->leftJoin('u.Email e');
Means : Get Users (who HAVE Phonenumbers (innerJoin)) with their potential (leftJoin) Groups, potential (leftJoin) Emails, and their Phonenumbers Not really the straight forward example we can expect in a documentation Best regards |
[DC-736] [Documentation] Taking Advantage of Column Aggregation Inheritance Created: 14/Jun/10 Updated: 14/Jun/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jason Brumwell | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The documentation at http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/taking-advantage-of-column-aggregation-inheritance/en#taking-advantage-of-column-aggregation-inheritance states when using foreign keys with column aggregation to set: $this->options('export','tables'); this didn't work for me after looking into it I see it should be attributes so in the base class you can write: $this->setAttribute(Doctrine_Core::ATTR_EXPORT, Doctrine_Core::EXPORT_TABLES); or via schema: attributes: |
[DC-923] Documentation 1.2 #working-with-models error Created: 10/Nov/10 Updated: 10/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Martin Babic | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 10.4, LAMP |
||
| Description |
|
In documentation There's an error in example code: // test.php // ... $user = new User(); $user->username = 'Some User'; $user->Groups[0]->username = 'Some Group'; $user->Groups[1]->username = 'Some Other Group'; $user->save(); The error is on lines: $user->Groups[0]->username = $user->Groups[1]->username = they shoud be: $user->Groups[0]->name = $user->Groups[1]->name = as there's no username column in schema.yml definition of Group object. |
[DC-872] 1.2 Documentation on Aggregate Functions Error Created: 21/Sep/10 Updated: 21/Sep/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Isaac Foster | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In the documentation for using aggregate values with Doctrine Query (link below), there is a code snippet that shows how to access the value of the aggregate field, which does not work. The code snippet is: //firstsnippet after header //second snippet after header //fourth snippet after header The code from the last snippet for accessing the count value, $users->num_threads, doesn't seem to work. What does work for me is: //access count value //My exact code is: echo $result->batchCount; //10 It's certainly possible I'm doing something wrong, or that there is a Doctrine_Core attribute I need to set. If there is a Doctrine_Core attribute to set to automatically access aggregate values from the Collection, it would be worth noting at the top of the section. Thanks, and thanks for Doctrine (so awesome). |
[DC-868] [Documentation] Column aggregation Created: 16/Sep/10 Updated: 16/Sep/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Michael Simpson | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The example in the documentation at http://www.doctrine-project.org/documentation/manual/1_2/en/inheritance:column-aggregation suggests that the discriminator (in this case 'type') column does not need to be defined in the parent class 'Entity'. This did not work for me, I had to declare the discriminator column as shown in the 'Taking advantage of column aggregation inheritance' chapter at http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/taking-advantage-of-column-aggregation-inheritance/en. |
[DC-846] Provide documentation for connection options Created: 29/Aug/10 Updated: 29/Aug/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Ritty | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
Provide additional information on connection options. $conn = Doctrine_Manager::connection('mysql://username:password@localhost/test', 'connection 1'); just skims the surface. At least link to PDO docs. Also, what is the second parameter? I can look in API docs, but it would be helpful to have in the reference guide. Are there any other ways to make a connection, such as through an array of parameters? |
[DC-1012] Doctrine_core specified twice in documentation Defining Models -> Join Table Associations Created: 28/Jun/11 Updated: 28/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Justinas | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
$manager->setAttribute(Doctrine_Core::Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); should be: $manager->setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); |
[DC-1001] Doctrine Caching page does not mention the "prefix" option Created: 29/Apr/11 Updated: 27/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching, Documentation |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Arend van Waart | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
http://www.doctrine-project.org/documentation/manual/1_1/en/caching When not using a prefix with multiple / yet similay projects a mixup of query caching will occur (for example with sfDoctrineGuard queries). This is very easialy fixed with a prefix - but I only realized after two months - that this feature actually existed. There is no mention of this in the documention. A mention of the feature $q = Doctrine_Query::create() Would have helped me and I think it will also help others. |
| Comments |
| Comment by Pablo Grass [ 27/Jun/11 ] |
|
I concur with Arend - mentioning of 'prefix' in the documentation could make this valuable feature much less of a pain to find... |
[DC-995] Doctrine deprecated in favor of Doctrine_Core - phpdoc Created: 06/Apr/11 Updated: 06/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Pablo Grass | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
all environments |
||
| Description |
|
http://www.doctrine-project.org/projects/orm/1.2/docs/whats-new/en clearly states that the Doctrine class is deprecated - e.g. in order to allow for proper autoloading. @deprecated In favor of Doctrine_Core - this class extends Doctrine_Core for BC |
[DC-738] Missing reference to make code usable Created: 15/Jun/10 Updated: 17/Jun/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Dennis Gearon | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Doctrine web site |
||
| Description |
|
Web page documentation is missing some details on following page: // ... I think they were just taken out of context from a page like: Where does the $manager variable come into this? FWIW, I tried that code to get the connection name in a Symfony/Doctrine CLI Task, and it says, 'using object accessor on non object'. I'll keep working on what it's supposed to look like, but the last page above, and every page of documentation derived from it should be checked for the relevance and accuracy of the $manager variable. |
[DC-909] Add Some Info to Doctrine Query order by Method Documentation Created: 01/Nov/10 Updated: 01/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Isaac Foster | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
n/a |
||
| Description |
|
This is very minor, but would have saved me a few minutes. On the Doctrine Query documentation page (V1 - http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#order-by-clause), it would be useful to note that multiple calls to Doctrine_Query::orderBy() do not stack, and that the later calls will over write the previous ones. I'll propose: To sort by multiple columns, you must specify them in one call to Doctrine_Query::orderBy(). If you call orderBy a second time, the column from the first call will not be included in the resulting query. <code> //does not work as expected |
[DC-906] Missing retrieval method Created: 30/Oct/10 Updated: 31/Oct/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Christopher W. Allen-Poole | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
online |
||
| Description |
|
This page: only lists svn as a way to check out the doctrine source. It's also available via git. |
[DC-1039] Return value of function Doctrine_Tree_NestedSet::fetchRoot($id) Created: 31/Oct/11 Updated: 31/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Trivial |
| Reporter: | Dmitry Artanov | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In api documentation about Doctrine_Tree_NestedSet::fetchRoot($id) said - it return void. But this is not true. This function return mixed - bool or model data. |
[DC-786] phpdoc comment error Created: 14/Jul/10 Updated: 14/Jul/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial |
| Reporter: | mike | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
n/a |
||
| Description |
|
in Doctrine/Core.php on line 881 comment for method generateModelsFromYaml() is: should be: |