[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-991) Make seam managed PC replacement for Spring OpenXXXInView
Michael Youngstrom (JIRA)
jira-events at lists.jboss.org
Wed Mar 28 19:06:22 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-991?page=comments#action_12357713 ]
Michael Youngstrom commented on JBSEAM-991:
Just committed initial true Spring integration with Seam Managed PC. Contains the following features:
* Automatically makes Seam Managed PC available to spring JPA utilities like JpaTemplate and Spring beans using the spring PersistenceAnnotationBeanPostProcessor.
* If a Seam Managed PC is accessed outside the scope of a Seam Lifecycle.beginCall() (because of a quartz job or something) then this will automatically make a Seam call available scoped to the current spring transaction so that the Seam Managed PC will function without having to make all the spring beans that use the Seam PC into Seam components.
* It is now possible to use the Seam Managed PC with spring managed Transactions though long lasting conversation scoped PCs will have to manually be flushed rather than allowing allowing Seam to automatically flush the PC at conversation end.
* Paves the way for using a Seam Managed PC in a Spring typical multi tiered application where Seam is the view and Spring makes up the Service Layer.
To use declare a SeamManagedEntityManagerFactoryBean like so where persistenceContextName is the name of the Seam MangedPersistenceContext Component:
<bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
<property name="persistenceContextName" value="entityManager"/>
Then use just like any other EntityManagerFactory in spring. Inject into a JpaTemplate, use with PersistenceAnnotationBeanPostProcessor, inject in to bean that extends JpaDaoSupport, etc.
The example spring example also shows how the Seam Managed PC will work just fine where a Seam call is not available.
Please try it out and let me know what you think. I'll probably make a few more tweaks and add documentation before I close this issue.
> Make seam managed PC replacement for Spring OpenXXXInView
> Key: JBSEAM-991
> URL: http://jira.jboss.com/jira/browse/JBSEAM-991
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Spring
> Affects Versions: 1.2.0.GA
> Reporter: Michael Youngstrom
> Assigned To: Michael Youngstrom
> Fix For: 1.3.0.BETA1
> True seam hibernate and JPA integration would be to replace the Spring OpenEntityManagerInView and OpenSessionInView filters with a Seam managed Persistence Context.
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues