[
https://issues.jboss.org/browse/SEAMPERSIST-75?page=com.atlassian.jira.pl...
]
Anthony O. edited comment on SEAMPERSIST-75 at 12/8/11 3:36 AM:
----------------------------------------------------------------
That's a pain... is it planned ?
And why you not just add firstly the {{SeamPersistenceProvider}} detected by the
{{ServiceLoader}} and only then add manually the {{HibernatePersistenceProvider}}, in
order to permit the user to really use the {{HibernatePersistenceProvider}} feature ?
(see my submitted patch)
was (Author: aogier):
Firstly add the {{SeamPersistenceProvider}} detected by the {{ServiceLoader}} and only
then add manually the {{HibernatePersistenceProvider}}, in order to permit the user to
really use the {{HibernatePersistenceProvider}} feature.
Provide a way to intercept method calls from EntityManager
----------------------------------------------------------
Key: SEAMPERSIST-75
URL:
https://issues.jboss.org/browse/SEAMPERSIST-75
Project: Seam Persistence
Issue Type: Feature Request
Affects Versions: 3.1.0.Beta4
Reporter: Anthony O.
Priority: Critical
Fix For: 3.1.0.Final
Attachments: ManagedPersistenceContextExtension.java.patch
I'm trying to intercept method calls to {{EntityManager}} in order to make
modifications to some entities before persisting them.
I've tried many ways to do that (see
http://stackoverflow.com/questions/8213285/how-to-intercept-methods-of-en...)
but I see that the real problem is that it's not easy to make a proxy behind the
{{EntityManager}} bean created by
{{org.jboss.seam.persistence.ManagedPersistenceContextExtension}}.
It seems that a way to do that has been thinked, but cannot be used today. In
{{ManagedPersistenceContextExtension.beforeBeanDiscovery}}, a {{Set}} of
{{SeamPersistenceProvider}} s is created *BUT*
{{org.jboss.seam.persistence.HibernatePersistenceProvider}} is always put in front of all
others, so we cannot create our own provider to extend the features of current ones as it
is chosen in EE environment which use hibernate (JBoss 7 for instance).
I think the best way to do that would be to create a {{Producer}} bean and not an
instanciable bean, as with CDI we could replace that {{Producer}} with an {{@Observes
ProcessProducer}} and a {{setProducer()}} to extend it.
At the moment, we can only {{@Observes ProcessBean}} on the {{EntityManager}} bean
created by Seam Persistence, and do nothing about it as the CDI spec doesn't enable us
to ask the container to replace the observed bean with {{ProcessBean}}.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira