Мул JPA сохраняться не вставляется или обновляется

Я использую модуль Mule JPA для извлечения и вставки / обновления данных. Я могу получить данные, но не могу обновить БД. Это не дает ошибок и согласно журналу кажется, что запись была обновлена. Но :( Если я проверяю БД, запись не вставляется. Я считаю, что транзакция не фиксируется.

Пожалуйста, помогите мне, как решить эту проблему.

Вот мой mflow

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jpa="http://www.mulesoft.org/schema/mule/jpa"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jpa http://www.mulesoft.org/schema/mule/jpa/current/mule-jpa.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">

  <spring:beans>
           <spring:import resource="classpath:applicationContext.xml" />
    </spring:beans>


        <jpa:config name="Java_Persistence_API" entityManagerFactory-ref="entityManagerFactory" doc:name="Java Persistence API"/>
    <flow name="jpa-exampleFlow1" doc:name="jpa-exampleFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
        <logger message="payload ----&gt;&gt;&gt;&gt; #[payload]" level="INFO" doc:name="Logger"/>
     <logger message="#[message.inboundProperties.get(&quot;http.relative.path&quot;)]" level="INFO" doc:name="Logger"/>
        <choice doc:name="Choice">
            <when expression="#[message.inboundProperties.get(&quot;http.relative.path&quot;)==&quot;getContact&quot;]">
                <logger message="in GetContact" level="INFO" doc:name="Logger"/>
                <component class="com.test.test.GetContact" doc:name="Java"/>
                <jpa:query statement="from ContactEO contact where contact.firstName = :firstName" queryParameters-ref="#[payload:]"></jpa:query>
                    <!-- <jpa:query statement="from ContactEO contact where contact.id = :id" queryParameters-ref="#[payload:]"/> -->
            </when>
            <when expression="#[message.inboundProperties.get(&quot;http.relative.path&quot;)==&quot;addContact&quot;]">
                <logger message="In AddContact" level="INFO" doc:name="Logger"/>
                  <component class="com.test.test.AddContact" doc:name="Java"/>
               <transactional action="ALWAYS_BEGIN" doc:name="Transactional">
                 <jpa:persist  entity-ref="#[payload:]" config-ref="Java_Persistence_API" />
               </transactional>
            </when>
        </choice>
         <json:object-to-json-transformer doc:name="Object to JSON"/>
        <logger message="payload ----&gt;&gt;&gt;&gt; #[payload]" level="INFO" doc:name="Logger"/>
    </flow>
</mule>

Вот моя настойчивость.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
        version="1.0">

    <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">

    </persistence-unit>

</persistence>

Вот мой консольный журнал

2014-05-25 23:41:38,533 INFO [org.mule.api.processor.LoggerMessageProcessor] - <payload ---->>>> /addContact>
2014-05-25 23:41:38,568 INFO [org.mule.api.processor.LoggerMessageProcessor] - <addContact>
2014-05-25 23:41:38,586 INFO [org.mule.api.processor.LoggerMessageProcessor] - <In AddContact>
Hibernate: insert into contact (EMAIL, FIRSTNAME, LASTNAME) values (?, ?, ?)
2014-05-25 23:41:38,811 INFO [org.mule.api.processor.LoggerMessageProcessor] - <payload ---->>>> {"firstName":"king","lastName":"verma","email":"[email protected]","id":9}>

Ответы на вопрос(2)

Ваш ответ на вопрос