[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-274) EntityManager injection

Reto Ferri (JIRA) noreply at atlassian.com
Wed Mar 7 06:45:31 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-274?page=comments#action_26389 ] 

Reto Ferri commented on EJB-274:
--------------------------------

My idea behind this question is to inject an EntityManager (and nothing more) to all loaded or persisted entities(with the @PersistenceContext attribute). This seems for me a natural and good way to obtain an EntityManager also in an standanlone application. You still need to create an initial EntityManager and to set the transaction boundaries there, but from then you could rely on the injection of the EntityManager as in a container environment. As far as I can see, this would also allow to write entity beans which are usefull in standalone and container applications and it would avoid coupling of entity beans to a globally visible EntityManager. 
>From a design perspective, it looks for me quite natural that the EntityManager injects itself into all objects under its control, and also the performance penality is minimal, because it's just one more set operation, like an additional attribute. All of this could be made configurable. 

> EntityManager injection
> -----------------------
>
>          Key: EJB-274
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-274
>      Project: Hibernate Entity Manager
>         Type: New Feature

>   Components: EntityManager
>     Reporter: Reto Ferri

>
>
> Are there any plans to implement EntityManager incjection based on the @PersistenceContext attribute?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list