-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Open
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancementA general enhancement
Milestone
Description
Following up on basic JPA 4.0 runtime compatibility in #35705, we can add transactional support for EntityAgent management, similar to the existing support for Hibernate's StatelessSession in #7184.
The SmartFactoryBean#getObject(Class) mechanism can be used for dependency injection, along the lines of LocalSessionFactoryBean but following @PersistenceContext-style semantics for the EntityAgent proxy: delegating to a transactional EntityAgent if a transaction is active, performing a non-transactional operation otherwise.
The following additions are to be expected:
SharedEntityAgentCreatornext toSharedEntityManagerCreator(possibly sharing a commonInvocationHandlerimplementation, in particular a commonDeferredQueryInvocationHandler). While this will require building against the JPA 4.0 API, that class is standalone and does not break JPA 3.2 compatibility.AbstractEntityManagerFactoryBean#getObject(Class)supporting a sharedEntityAgentinstance next to its sharedEntityManager. This will require reflective loading of theEntityAgenttype without a hard reference to it, plus conditional initialization of an untypedsharedEntityAgentfield viaSharedEntityAgentCreatorthat can then be returned fromgetObject(Class)if the requested type is assignable to the reflectively loadedEntityAgentClass.
Metadata
Metadata
Assignees
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancementA general enhancement