Hi,
I now enlisted a participant with:
tm.getTransaction().enlistParticipant(false, new AbstractParticipant(){
protected int prepare() throws XAException {
System.out.println("prepare");
return 0;
}
protected void commit() throws XAException {
System.out.println("commit");
}
protected void rollback() throws XAException {
System.out.println("rollback");
}
protected void forget() {
System.out.println("forget");
}
protected int getStatus() {
System.out.println("status");
return 0;
}
});
The communication stops at the participant now and the message sent to
the participant is repeated:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soapenv:Header>
<wsa:MessageID
soapenv:mustUnderstand="0">uuid:ea657a30-e052-11da-83bf-c28378dc7021</wsa:MessageID>
<wsa:To
soapenv:mustUnderstand="0">http://localhost:8080/axis/services/participant</wsa:To>
<wsa:Action
soapenv:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepare</wsa:Action>
<wsa:From soapenv:mustUnderstand="0">
<wsa:Address>http://localhost:8080/axis/services/coordinator</wsa:Address>
<wsa:ReferenceProperties>
<ns1:CallbackRef
xmlns:ns1="http://ws.apache.org/kandula">uuid:a2412790-e052-11da-83be-c28378dc7021</ns1:CallbackRef>
<ns1:ParticipantRef
xmlns:ns1="http://ws.apache.org/kandula">uuid:a25e2570-e052-11da-83be-c28378dc7021</ns1:ParticipantRef>
</wsa:ReferenceProperties>
</wsa:From>
<wsa:FaultTo soapenv:mustUnderstand="0">
<wsa:Address>http://localhost:8080/axis/services/faultDispatcher</wsa:Address>
<wsa:ReferenceProperties>
<ns1:CallbackRef
xmlns:ns1="http://ws.apache.org/kandula">uuid:a2412790-e052-11da-83be-c28378dc7021</ns1:CallbackRef>
<ns1:ParticipantRef
xmlns:ns1="http://ws.apache.org/kandula">uuid:a25e2570-e052-11da-83be-c28378dc7021</ns1:ParticipantRef>
</wsa:ReferenceProperties>
</wsa:FaultTo>
<ns2:CallbackRef soapenv:mustUnderstand="0"
xmlns:ns2="http://ws.apache.org/kandula">uuid:a2568450-e052-11da-8e76-c5b20989c32e</ns2:CallbackRef>
</soapenv:Header>
<soapenv:Body>
<Prepare xsi:nil="true"
xmlns="http://schemas.xmlsoap.org/ws/2004/10/wsat"/>
</soapenv:Body>
</soapenv:Envelope>
What is my mistake?
Thanks,
Benjamin
OK,
the client does not stop automatically. 180secs after the commit was
called, there is a timeout fault on the server.
Can you please check if client-config.wsdd was deployed correctly also
on the server, and whether all messages contain WS-Addressing (To,
From, ...)-elements?
Moreover I thought that the coordinator would call either prepare or
commit of my service. This is not the case.
The coordinator does call Prepare and later either Rollback or Commit
on your _participant_. The participant is a kandula component (its
more or less the transaction manager) that does many protocol specific
things for you.
One of them is that it automatically responds to the prepare message
after polling all locally enlisted transaction ressources, and if they
are prepared, your whole participant is.
When receiving a commit/rollback notification from the coordinator,
their decicision is likewise forwarded to all local resources.
This was done for your convenience: just enlist all resources you used
in the global transaction, and they will automagically be committed or
rolled back -- your service shouldn't be doing something fundamentally
different, btw ;-)
If you want explicit control over prepare/commit, you'll have to
enlist a custom ressource in the ongoing transaction (with the
transaction manager). If you do so, the TransactionManager will
automatically ask it for preparedness and later tell the transaction
result.
Some test cases in the Testsuite use this pattern to emulate resouce
errors, so you may look there to see some examples.
best regards,
-hannes
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]