[jboss-cvs] jboss-seam/doc/reference/en/modules ...
Michael Youngstrom
youngm at gmail.com
Wed Aug 22 18:58:49 EDT 2007
User: myoungstrom
Date: 07/08/22 18:58:49
Modified: doc/reference/en/modules spring.xml persistence.xml
Log:
http://jira.jboss.com/jira/browse/JBSEAM-1834
Revision Changes Path
1.22 +6 -1 jboss-seam/doc/reference/en/modules/spring.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: spring.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/spring.xml,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- spring.xml 11 Jul 2007 17:22:51 -0000 1.21
+++ spring.xml 22 Aug 2007 22:58:49 -0000 1.22
@@ -208,7 +208,7 @@
</bean>]]></programlisting>
</section>
- <section>
+ <section id="spring-transactions">
<title>Using Spring PlatformTransactionManagement</title>
<para>Spring provides an extensible transaction management abstraction with support for many
@@ -224,6 +224,11 @@
<programlisting>
<![CDATA[<spring:spring-transaction platform-transaction-manager="#{transactionManager}"/>]]>
</programlisting>
+
+ <para>
+ The <literal>spring:spring-transaction</literal> component will utilize Springs transaction synchronization
+ capabilities for synchronization callbacks.
+ </para>
</section>
<section id="spring-persistence">
<title>Using a Seam Managed Persistence Context in Spring</title>
1.13 +128 -56 jboss-seam/doc/reference/en/modules/persistence.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: persistence.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/persistence.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- persistence.xml 21 Jun 2007 22:16:37 -0000 1.12
+++ persistence.xml 22 Aug 2007 22:58:49 -0000 1.13
@@ -181,9 +181,81 @@
</section>
- </section>
+ <section>
+ <title>Configuring a Seam transaction manager</title>
+ <para>
+ Seam provides a transaction management abstraction for beginning, committing, rolling back, and
+ synchronizing with a transaction. By default Seam uses a JTA transaction component that integrates with
+ Container Managed and programmatic EJB transactions. If JTA is not available then Seam will disable
+ Seam-managed transactions unless an alternative transaction component is configured.
+ </para>
+ <para>
+ Out of the box Seam provides transaction components for the following additional transaction APIs:
+ </para>
+ <ul>
+ <li>
+ JPA RESOURCE_LOCAL transactions with the
+ <literal>javax.persistence.EntityTransaction</literal>
+ interface.
+ </li>
+ <li>
+ Hibernate managed transactions with the
+ <literal>org.hibernate.Transaction</literal>
+ interface.
+ </li>
+ <li>
+ Spring managed transactions with the
+ <literal>org.springframework.transaction.PlatformTransactionManager</literal>
+ interface.
+ </li>
+ </ul>
+ <para>
+ Configure JPA RESOURCE_LOCAL transaction management by adding the following to your components.xml where
+ <literal>#{entityManager}</literal>
+ is the name of the
+ <literal>persistence:managed-persistence-context</literal>
+ component. (see
+ <link linkend="persistence.seam-managed-persistence-contexts">Seam-managed persistence contexts</link>
+ )
+ </para>
+ <programlisting><![CDATA[<transaction:entity-transaction entity-manager="#{entityManager}"/>]]></programlisting>
+ <para>
+ To configure Hibernate managed transactions declare the following in your components.xml where
+ <literal>#{hiberanteSession}</literal>
+ is the name of the project's
+ <literal>persistence:managed-hibernate-session</literal>
+ component. (see
+ <link linkend="persistence.seam-managed-persistence-contexts">Seam-managed persistence contexts</link>
+ )
+ </para>
+ <programlisting><![CDATA[<transaction:hibernate-transaction session="#{hiberanteSession}"/>]]></programlisting>
+ <para>
+ For configuring Spring managed transactions see
+ <link linkend="spring-transactions">using Spring PlatformTransactionManagement</link>
+ .
+ </para>
+ </section>
<section>
+ <title>Transaction synchronization</title>
+
+ <para>
+ Transaction synchronization is the ability to provide callbacks for various transaction related events
+ such as
+ <literal>beforeCompletion()</literal>
+ and
+ <literal>afterCompletion()</literal>
+ . By default Seam uses it's own transaction synchronization component which requires explicit use of the
+ Seam transaction component when committing a transaction to ensure synchronization callbacks are
+ correctly executed. If in a Java EE 5 environment the
+ <literal><transaction:ejb-transaction/></literal>
+ component should be be declared in the components.xml to ensure that Seam synchronization callbacks are
+ correctly called if the container commits a transaction outside of Seam's knowledge.
+ </para>
+ </section>
+ </section>
+
+ <section id="persistence.seam-managed-persistence-contexts">
<title>Seam-managed persistence contexts</title>
<para>
More information about the jboss-cvs-commits
mailing list