Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] DDC-3976 #1551

Merged
merged 1 commit into from
Nov 12, 2015
Merged

[RFC] DDC-3976 #1551

merged 1 commit into from
Nov 12, 2015

Conversation

guilhermeblanco
Copy link
Member

Fixes #1542

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DDC-3990

We use Jira to track the state of pull requests and the versions they got
included in.

@@ -96,6 +96,26 @@ public function testPutAndLoadManyToOneRelation()

$this->assertEquals($this->states[1]->getCountry()->getId(), $c4->getCountry()->getId());
$this->assertEquals($this->states[1]->getCountry()->getName(), $c4->getCountry()->getName());

//evict collection on add
$prev = $c3->getCities();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split into a separate test

@Ocramius
Copy link
Member

Except for the test note, 👍

$this->collectionUpdates[$coid] = $value;
}

$this->collectionUpdates[$coid] = $value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this making also the inverse side of collections checked? :-\

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you're indeed updating a collection adding/removing new items, so it should be checked depending of CollectionPersister implementation.
In most cases, it'll just return, except on CacheCollectionPersister, which would evict the collection (addressing the bug)

@@ -67,6 +67,7 @@ public function buildCacheEntry(ClassMetadata $metadata, CollectionCacheKey $key
foreach ($collection as $index => $entity) {
$data[$index] = new EntityCacheKey($metadata->name, $this->uow->getEntityIdentifier($entity));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline in unrelated file?

guilhermeblanco added a commit that referenced this pull request Nov 12, 2015
@guilhermeblanco guilhermeblanco merged commit 3a44a3d into master Nov 12, 2015
@guilhermeblanco guilhermeblanco deleted the DDC-3976 branch November 12, 2015 15:21
@nicolas-cajelli
Copy link

Hi @Ocramius @guilhermeblanco , i was just looking at the code, and i found out that this commit never reached the branch 2.5. Is there any reason for this?
We were discussing about this on #5821

@Ocramius
Copy link
Member

Possibly didn't manage to backport, or @guilhermeblanco decided that the fix didn't need backporting or is too much effort to do so.

@nicolas-cajelli
Copy link

@Ocramius is there any guide to know how you guys are doing the backport? I would like to help to do it.

@Ocramius
Copy link
Member

Ocramius commented Dec 4, 2016

@nicolas-cajelli don't have a guide, but here's what I do:

git checkout 2.5
git checkout -b a-new-branch-that-backports-fix-#1234-to-2.5
git cherry-pick aaaaaaa1
git cherry-pick aaaaaaa2
git cherry-pick aaaaaaa3
git push origin a-new-branch-that-backports-fix-#1234-to-2.5

Then open a PR from that branch to 2.5

Ocramius added a commit that referenced this pull request Dec 12, 2016
…ache-#1551-to-2.5

#5821 Backport #1551 - Fixed support for inverse side second level cache
AlexKryvets added a commit to AlexKryvets/doctrine2 that referenced this pull request Dec 23, 2016
This release relaxes [`doctrine/common`](https://github.com/doctrine/common) requirements
in order to allow installation of versions that support PHP 7.1 features in proxy class
generation. Please note that a similar requirement relaxation still needs to be applied to
[`doctrine/dbal`](https://github.com/doctrine/dbal) in order to allow installation of
the latest `doctrine/common` versions. [doctrine#6156](doctrine#6156)

This version also backports some fixes around the eviction of the second level cache entries
of inverse side associations in one-to-many - many-to-one mappings. [doctrine#6159](doctrine#6159)

Further fixes were applied in order to have child classes in inheritance mapping share the
same timestamp region when the second level cache is enabled. [doctrine#6028](doctrine#6028)

Also, `Doctrine\ORM\EntityManager#merge()` now triggers `Doctrine\ORM\Events::prePersist`
listeners with the merged entity state whenever an internal `Doctrine\ORM\UnitOfWork#persist()`
call is implied. [doctrine#6177](doctrine#6177).

Total issues resolved: **8**

- [5570: Fix PrePersist EventListener when using merge instead of persist](doctrine#5570)
- [6028: Make child entity share the timestamp region with parent class](doctrine#6028)
- [6110: Clear $this->collection even when empty, to reset keys](doctrine#6110)
- [6156: Allow doctrine/common 2.7](doctrine#6156)
- [6159: doctrine#5821 Backport doctrine#1551 - Fixed support for inverse side second level cache](doctrine#6159)
- [6174: Merging a new entity with PrePersist event make changes in callback not be considered](doctrine#6174)
- [6177: Fix doctrine#6174 doctrine#5570: merging new entities should also trigger prepersist lifecycle callbacks with merged entity data](doctrine#6177)
- [6178: Backport doctrine#6177 - fix doctrine#6174 doctrine#5570: merging new entities should also trigger prepersist lifecycle callbacks with the merged data](doctrine#6178)

# gpg: directory `/c/Users/PC/.gnupg' created
# gpg: new configuration file `/c/Users/PC/.gnupg/gpg.conf' created
# gpg: WARNING: options in `/c/Users/PC/.gnupg/gpg.conf' are not yet active during this run
# gpg: keyring `/c/Users/PC/.gnupg/pubring.gpg' created
# gpg: Signature made Tue Dec 20 00:49:05 2016 FLEST using DSA key ID 12EC2DF8
# gpg: Can't check signature: public key not found

# Conflicts:
#	lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
#	lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
#	tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php
#	tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php
#	tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php
@lcobucci lcobucci added this to the 2.5.6 milestone Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants