Hello,
i am wondering if there is a simple way to use one transaction while
calling two times the same webservice.
I am currently evaluating the following test scenario:
1. Invoke BPEL Process via SOAP Message
2. Call Webservice and persist something
3. Call Webservice again, but this time throw an exception
In Step 3, the transaction is rolled back, unfortunately the result of 2
is still persisted.
The logs [4] show that the transaction commits immediately after step 2.
The same result occurs, when the Bpel process invokes another bpel
process which then invokes the webservice twice. See [1] for details.
There it says (answer from kiran.bhumana
<
http://forums.sun.com/profile.jspa?userID=631098> ), this should work.
Both bpel processes are atomic (i also tried only the second one to be
atomic or none at all, it ends always with the same result.)
[1]
http://forums.sun.com/thread.jspa?threadID=5261184
Is this just not possible that way? I added wsat policies (to required)
and thought that way it should work. So the wsdl invoking the (first)
bpel is set to requires new (i also tried required). Is [2] the only way
how this can be done? Both the webservice and the bpel process are
running on the same machine and domain. I think this question was asked
already[3]. I got [2] running and i am wondering if that is the only way
to handle transactions with glassfish. (I am using v.2.1)
[2]
https://metro.dev.java.net/guide/About_the_basicWSTX_Example.html
[3]
https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=30422
Thanks in advance!
Harald
LOG [4]:
--Created new J2EETransaction, txId = 6
TM: enlistComponentResources
--In J2EETransaction.registerSynchronization, jtsTx=null
nonXAResource=null
TM: enlistComponentResources
--In J2EETransaction.registerSynchronization, jtsTx=null
nonXAResource=null
--In J2EETransaction.registerSynchronization, jtsTx=null
nonXAResource=null
In J2EETransactionManagerOpt.enlistResource, h=552
h.xares=com.sun.gjc.spi.XAResourceImpl_at_fdeec4
h.alloc=com.sun.enterprise.resource.ConnectorAllocator_at_11a3a26
tx=J2EETransaction: txId=6 nonXAResource=null jtsTx=null localTxStatus=0
syncs=[com.sun.ejb.containers.ContainerSynchronization_at_146b58e,
org.hibernate.transaction.CacheSynchronization,
org.hibernate.ejb.AbstractEntityManagerImpl$1_at_1398fb9]
TM: begin
TM: enlistResource
--In J2EETransaction.enlistResource,
jtsTx=com.sun.jts.jta.TransactionImpl_at_107a3706 nonXAResource=null
--In J2EETransaction.registerSynchronization,
jtsTx=com.sun.jts.jta.TransactionImpl_at_107a3706 nonXAResource=null
Hibernate: insert into Person (firstName, lastName) values (?, ?)
TM: delistResource
Saved new Person with id 5
throwException is: false
TM: commit
--Created new J2EETransaction, txId = 7
TM: enlistComponentResources
--In J2EETransaction.registerSynchronization, jtsTx=null
nonXAResource=null
TM: enlistComponentResources
--In J2EETransaction.registerSynchronization, jtsTx=null
nonXAResource=null
--In J2EETransaction.registerSynchronization, jtsTx=null
nonXAResource=null
In J2EETransactionManagerOpt.enlistResource, h=553
h.xares=com.sun.gjc.spi.XAResourceImpl_at_657688
h.alloc=com.sun.enterprise.resource.ConnectorAllocator_at_11a3a26
tx=J2EETransaction: txId=7 nonXAResource=null jtsTx=null localTxStatus=0
syncs=[com.sun.ejb.containers.ContainerSynchronization_at_148f7a5,
org.hibernate.transaction.CacheSynchronization,
org.hibernate.ejb.AbstractEntityManagerImpl$1_at_17a7873]
TM: begin
TM: enlistResource
--In J2EETransaction.enlistResource,
jtsTx=com.sun.jts.jta.TransactionImpl_at_81fc7a67 nonXAResource=null
--In J2EETransaction.registerSynchronization,
jtsTx=com.sun.jts.jta.TransactionImpl_at_81fc7a67 nonXAResource=null
Hibernate: insert into Person (firstName, lastName) values (?, ?)
TM: delistResource
Saved new Person with id 6
throwException is: false
TM: commit