Initial improved bytecode enhancement support

Description

Introduce org.hibernate.engine.internal.EntityEntryContext, org.hibernate.engine.spi.ManagedEntity, etc as a means to allow increased performance for Session-related memory and CPU overheads.

org.hibernate.engine.internal.EntityEntryContext is a context for maintaining the relation between an entity associated with the Session owning this EntityEntryContext and that entity's corresponding org.hibernate.engine.spi.ManagedEntity reference.

org.hibernate.engine.spi.ManagedEntity is a contract for describing an entity's association with a Session. It gives us access to information (specific to each entity instance) such as it's org.hibernate.engine.spi.EntityEntry as well as defining a doubly-linked graph via org.hibernate.engine.spi.ManagedEntity#$$_hibernate_getPreviousManagedEntity and org.hibernate.engine.spi.ManagedEntity#$$_hibernate_getNextManagedEntity

There are 2 forms of org.hibernate.engine.spi.ManagedEntity supported. First is for the entity to implement the ManagedEntity interface, either directly or through bytecode manipulation. Second is for Hibernate to "wrap" the entity in a ManagedEntity implementation (legacy Hibernate did this anyway, in terms of wrapping the entity as it was added to IdentityMap).

An Ant task to perform enhancing was added here as well. Gradle and Maven support are tagged in and HHH-8337, respectively.

See for follow-on tasks...


Initially, this issue started as an investigation into expanding bytecode enhancement support to cover a variety of topics such as

  • removing load (EntityEntry, etc) from PersistenceContext - important in removing reliance on IdentityMap and reducing Session-related memory and CPU overheads

  • dirtiness handling

  • lazy initialization - both through interception and through generated "proxies" (generated class)

  • bi-directional association management

  • anything else?

The first bullet above is the feature implemented here. The other bullets have all moved to and its sub-tasks.

Activity

Show:

Steve EbersoleJuly 10, 2013 at 5:23 PM

Description updated

Steve EbersoleJuly 10, 2013 at 4:56 PM

Improving description...

Steve EbersoleMarch 16, 2013 at 5:24 PM

On the first was handled in this set of changes.

Strong LiuMarch 16, 2013 at 8:59 AM

from the code change, I think dirtiness handling is not implemented yet, is it?

Fixed

Details

Assignee

Reporter

Time tracking

35.98h logged

Components

Priority

Created October 3, 2012 at 7:18 PM
Updated July 10, 2013 at 5:23 PM
Resolved July 10, 2013 at 5:23 PM