« Previous | Next » 

Revision a532ede6


Added by Robert Lemke over 8 years ago

[BUGFIX] Lazy DI causes endless loop for certain session objects

Fixes an issue with the Lazy Dependency Injection mechanism which caused
and endless loop if session-scoped objects were unserialized and later on
injected lazily.


when a session is resumed (rather early in the HTTP Request Handler), the
objects contained in the session are unserialized and register their
instance automatically at the Object Manager. If
such an object, for example the Security Context, is later on injected
lazily into another class, the generated proxy code will overwrite the
instance which was previously set at the Object Manager.

In the reported case the RequestHandler retrieved the Security Context
via ObjectManager->get() and received a DependencyProxy instead of the
expected real instance. On using it, the DependencyProxy called the
ObjectManager->get() method to retrieve the real instance which resulted
in a recursion.

This patch corrects the generated proxy code to check for an existing
real instance before trying to generate a Dependency Proxy.

Change-Id: I3b8997ce07a8d36e7cc6b47e31ea8d52547d10a1
Resolves: #46424
Releases: master, 2.0

  • added
  • modified
  • copied
  • renamed
  • deleted