我的代码是
<int-jpa:outbound-channel-adapter
channel="nativeQlChannel"
native-query="insert into responsestatus(partner_id,response) values (:pid,:response)"
entity-manager="entityManager" >
<int-jpa:parameter name="pid" expression="payload['pid']" />
<int-jpa:parameter name="response" expression="payload['response']" >
</int-jpa:outbound-channel-adapter>
例外
Caused by: javax.persistence.TransactionRequiredException: Executing an update/delete query
at org.hibernate.jpa.spi.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:372)
at com.sun.proxy.$Proxy29.executeUpdate(Unknown Source)