This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener). # HTTP URLs that Could Not Be Fixed These URLs were unable to be fixed. Please review them to see if they can be manually resolved. * http://joda-time.sourceforge.net/ (200) with 1 occurrences could not be migrated: ([https](https://joda-time.sourceforge.net/) result AnnotatedConnectException). * http://www.jjg.net/ia/visvocab/ (200) with 1 occurrences could not be migrated: ([https](https://www.jjg.net/ia/visvocab/) result AnnotatedConnectException). # Fixed URLs ## Fixed But Review Recommended These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended. * http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd (301) with 1 occurrences migrated to: https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/orm_2_1.xsd ([https](https://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd) result InvalidMediaTypeException). * http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd (ReadTimeoutException) with 2 occurrences migrated to: https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ([https](https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd) result ReadTimeoutException). * http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd (404) with 2 occurrences migrated to: https://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd ([https](https://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd) result 404). ## Fixed Success These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended. * http://static.springframework.org/spring-security/site/reference.html (301) with 2 occurrences migrated to: https://docs.spring.io/spring-security/site/reference.html ([https](https://static.springframework.org/spring-security/site/reference.html) result 200). * http://static.springsource.org/spring/docs/2.5.x/reference/mvc.html (301) with 1 occurrences migrated to: https://docs.spring.io/spring/docs/2.5.x/reference/mvc.html ([https](https://static.springsource.org/spring/docs/2.5.x/reference/mvc.html) result 200). * http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html (301) with 1 occurrences migrated to: https://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/expressions.html ([https](https://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html) result 200). * http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/index.html (301) with 1 occurrences migrated to: https://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/index.html ([https](https://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/index.html) result 200). * http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html (301) with 1 occurrences migrated to: https://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/mvc.html ([https](https://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html) result 200). * http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/validation.html (301) with 2 occurrences migrated to: https://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/validation.html ([https](https://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/validation.html) result 200). * http://en.wikipedia.org/wiki/Unified_Expression_Language with 1 occurrences migrated to: https://en.wikipedia.org/wiki/Unified_Expression_Language ([https](https://en.wikipedia.org/wiki/Unified_Expression_Language) result 200). * http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd (301) with 2 occurrences migrated to: https://hibernate.org/dtd/hibernate-mapping-3.0.dtd ([https](https://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd) result 200). * http://jira.spring.io with 1 occurrences migrated to: https://jira.spring.io ([https](https://jira.spring.io) result 200). * http://primefaces.org/documentation.html with 1 occurrences migrated to: https://primefaces.org/documentation.html ([https](https://primefaces.org/documentation.html) result 200). * http://search.maven.org with 1 occurrences migrated to: https://search.maven.org ([https](https://search.maven.org) result 200). * http://tiles.apache.org/dtds/tiles-config_3_0.dtd with 1 occurrences migrated to: https://tiles.apache.org/dtds/tiles-config_3_0.dtd ([https](https://tiles.apache.org/dtds/tiles-config_3_0.dtd) result 200). * http://www.springframework.org/schema/beans/spring-beans.xsd with 15 occurrences migrated to: https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200). * http://www.springframework.org/schema/faces/spring-faces.xsd with 4 occurrences migrated to: https://www.springframework.org/schema/faces/spring-faces.xsd ([https](https://www.springframework.org/schema/faces/spring-faces.xsd) result 200). * http://www.springframework.org/schema/mvc/spring-mvc.xsd with 4 occurrences migrated to: https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200). * http://www.springframework.org/schema/webflow-config/spring-webflow-config.xsd with 6 occurrences migrated to: https://www.springframework.org/schema/webflow-config/spring-webflow-config.xsd ([https](https://www.springframework.org/schema/webflow-config/spring-webflow-config.xsd) result 200). * http://www.springframework.org/schema/webflow/spring-webflow.xsd with 45 occurrences migrated to: https://www.springframework.org/schema/webflow/spring-webflow.xsd ([https](https://www.springframework.org/schema/webflow/spring-webflow.xsd) result 200). * http://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html with 1 occurrences migrated to: https://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html ([https](https://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html) result 301). * http://springframework.org with 1 occurrences migrated to: https://springframework.org ([https](https://springframework.org) result 301). * http://www.docbook.org/xml/5.0/xsd/docbook.xsd with 16 occurrences migrated to: https://www.docbook.org/xml/5.0/xsd/docbook.xsd ([https](https://www.docbook.org/xml/5.0/xsd/docbook.xsd) result 301). * http://www.docbook.org/xml/5.0/xsd/xlink.xsd with 15 occurrences migrated to: https://www.docbook.org/xml/5.0/xsd/xlink.xsd ([https](https://www.docbook.org/xml/5.0/xsd/xlink.xsd) result 301). * http://java.sun.com/dtd/facelet-taglib_1_0.dtd with 1 occurrences migrated to: https://java.sun.com/dtd/facelet-taglib_1_0.dtd ([https](https://java.sun.com/dtd/facelet-taglib_1_0.dtd) result 302). * http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd with 1 occurrences migrated to: https://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd ([https](https://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd) result 302). * http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd with 1 occurrences migrated to: https://java.sun.com/xml/ns/persistence/persistence_1_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_1_0.xsd) result 302). * http://repo.spring.io/snapshot with 1 occurrences migrated to: https://repo.spring.io/snapshot ([https](https://repo.spring.io/snapshot) result 302). * http://www.paypal.com?_callbackUrl= with 1 occurrences migrated to: https://www.paypal.com?_callbackUrl= ([https](https://www.paypal.com?_callbackUrl=) result 302). # Ignored These URLs were intentionally ignored. * http://docbook.org/ns/docbook with 32 occurrences * http://java.sun.com/jsf/facelets with 2 occurrences * http://java.sun.com/jsf/html with 2 occurrences * http://java.sun.com/xml/ns/javaee with 2 occurrences * http://java.sun.com/xml/ns/persistence with 2 occurrences * http://localhost/app/hotels/booking?hotelId=1 with 1 occurrences * http://www.springframework.org/schema/beans with 30 occurrences * http://www.springframework.org/schema/faces with 8 occurrences * http://www.springframework.org/schema/mvc with 8 occurrences * http://www.springframework.org/schema/webflow with 96 occurrences * http://www.springframework.org/schema/webflow-config with 12 occurrences * http://www.springframework.org/security/tags with 2 occurrences * http://www.springframework.org/security/tags</namespace> with 1 occurrences * http://www.w3.org/1999/xhtml with 2 occurrences * http://www.w3.org/1999/xlink with 30 occurrences * http://www.w3.org/2001/XInclude with 31 occurrences * http://www.w3.org/2001/XMLSchema-instance with 81 occurrences * http://xmlns.jcp.org/xml/ns/persistence/orm with 2 occurrences
94 lines
5.1 KiB
XML
94 lines
5.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<chapter xml:id="flow-managed-persistence"
|
|
xmlns="http://docbook.org/ns/docbook" version="5.0"
|
|
xmlns:xl="http://www.w3.org/1999/xlink"
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="
|
|
http://docbook.org/ns/docbook https://www.docbook.org/xml/5.0/xsd/docbook.xsd
|
|
http://www.w3.org/1999/xlink https://www.docbook.org/xml/5.0/xsd/xlink.xsd">
|
|
<title>Flow Managed Persistence</title>
|
|
<sect1 xml:id="flow-managed-persistence-introduction">
|
|
<title>Introduction</title>
|
|
<para>
|
|
Most applications access data in some way.
|
|
Many modify data shared by multiple users and therefore require transactional data access properties.
|
|
They often transform relational data sets into domain objects to support application processing.
|
|
Web Flow offers "flow managed persistence" where a flow can create, commit, and close a object persistence context for you.
|
|
Web Flow integrates both Hibernate and JPA object persistence technologies.
|
|
</para>
|
|
<para>
|
|
Apart from flow-managed persistence, there is the pattern of fully encapsulating PersistenceContext management within the service layer of your application.
|
|
In that case, the web layer does not get involved with persistence, instead it works entirely with detached objects that are passed to and returned by your service layer.
|
|
This chapter will focus on the flow-managed persistence, exploring how and when to use this feature.
|
|
</para>
|
|
</sect1>
|
|
<sect1 xml:id="flowScopedPersistenceContext">
|
|
<title>FlowScoped PersistenceContext</title>
|
|
<para>
|
|
This pattern creates a <code>PersistenceContext</code> in <code>flowScope</code> on flow startup,
|
|
uses that context for data access during the course of flow execution, and commits changes made to persistent entities at the end.
|
|
This pattern provides isolation of intermediate edits by only committing changes to the database at the end of flow execution.
|
|
This pattern is often used in conjunction with an optimistic locking strategy to protect the integrity of data modified in parallel by multiple users.
|
|
To support saving and restarting the progress of a flow over an extended period of time, a durable store for flow state must be used.
|
|
If a save and restart capability is not required, standard HTTP session-based storage of flow state is sufficient.
|
|
In that case, session expiration or termination before commit could potentially result in changes being lost.
|
|
</para>
|
|
<para>
|
|
To use the FlowScoped PersistenceContext pattern, first mark your flow as a <code>persistence-context</code>:
|
|
</para>
|
|
<programlisting language="xml"><![CDATA[
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<flow xmlns="http://www.springframework.org/schema/webflow"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/webflow
|
|
https://www.springframework.org/schema/webflow/spring-webflow.xsd">
|
|
|
|
<persistence-context />
|
|
|
|
</flow>
|
|
]]></programlisting>
|
|
<para>
|
|
Then configure the correct <code>FlowExecutionListener</code> to apply this pattern to your flow.
|
|
If using Hibernate, register the <code>HibernateFlowExecutionListener</code>. If using JPA, register the <code>JpaFlowExecutionListener</code>.
|
|
</para>
|
|
<programlisting language="xml"><![CDATA[
|
|
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
|
|
<webflow:flow-execution-listeners>
|
|
<webflow:listener ref="jpaFlowExecutionListener" />
|
|
</webflow:flow-execution-listeners>
|
|
</webflow:flow-executor>
|
|
|
|
<bean id="jpaFlowExecutionListener"
|
|
class="org.springframework.webflow.persistence.JpaFlowExecutionListener">
|
|
<constructor-arg ref="entityManagerFactory" />
|
|
<constructor-arg ref="transactionManager" />
|
|
</bean>
|
|
]]></programlisting>
|
|
<para>
|
|
To trigger a commit at the end, annotate your end-state with the commit attribute:
|
|
</para>
|
|
<para>
|
|
<programlisting language="xml"><![CDATA[
|
|
<end-state id="bookingConfirmed" commit="true" />
|
|
]]></programlisting>
|
|
</para>
|
|
<para>
|
|
That is it. When your flow starts, the listener will handle allocating a new <code>EntityManager</code> in <code>flowScope</code>.
|
|
Reference this EntityManager at anytime from within your flow by using the special <code>persistenceContext</code> variable.
|
|
In addition, any data access that occurs using a Spring managed data access object will use this EntityManager automatically.
|
|
Such data access operations should always execute non transactionally or in read-only transactions to maintain isolation of intermediate edits.
|
|
</para>
|
|
</sect1>
|
|
<sect1 xml:id="flow-managed-persistence-propagation">
|
|
<title>Flow Managed Persistence And Sub-Flows</title>
|
|
<para>
|
|
A flow managed <code>PersistenceContext</code> is automatically extended
|
|
(propagated) to subflows assuming the subflow also has the <code><perstistence-context/></code>
|
|
variable. When a subflow re-uses the <code>PersistenceContext</code> started by its parent it ignores
|
|
commit flags when an end state is reached thereby deferring the final decision (to commit or not) to
|
|
its parent.
|
|
</para>
|
|
</sect1>
|
|
</chapter>
|