ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre SAPANEL <alexandre.sapa...@photobox.com>
Subject RE: Parallel foreach with correlation
Date Fri, 15 Jul 2011 11:39:09 GMT
It works but now I've got an exception when I send two messages
simultaneously (handled by the receive activity) and the scopes are still
ACTIVE instead of COMPLETED



[2011-07-15 13:32:28,841] DEBUG: Rollbacking on
org.apache.geronimo.transaction.manager.GeronimoTransactionManager@aa559d.
.. [org.apache.ode.scheduler.simple.SimpleScheduler]
[2011-07-15 13:32:28,841] DEBUG: Will retry the transaction in 1000 msecs
on
org.apache.geronimo.transaction.manager.GeronimoTransactionManager@aa559d
for error:  [org.apache.ode.scheduler.simple.SimpleScheduler]
org.apache.ode.scheduler.simple.JobNoLongerInDbException: Job no longer in
db: hqejbhcnphr6fpt1p71c9r nodeId=hqejbhcnphr6fpt1p71c7e
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSchedu
ler.java:516)
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSchedu
ler.java:512)
	at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSche
duler.java:284)
	at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSche
duler.java:239)
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedule
r.java:512)
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedule
r.java:496)
	at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.
java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
:908)
	at java.lang.Thread.run(Thread.java:619)
[2011-07-15 13:32:29,839] DEBUG: Beginning a new transaction
[org.apache.ode.scheduler.simple.SimpleScheduler]
[2011-07-15 13:32:29,839] DEBUG: deleteJob hqejbhcnphr6fpt1p71c9r on node
hqejbhcnphr6fpt1p71c7e [org.apache.ode.scheduler.simple.JdbcDelegate]
[2011-07-15 13:32:29,839] DEBUG: getConnection (tx=2) [org.apache.ode.sql]
[2011-07-15 13:32:29,839] DEBUG: prepareStatement: delete from ODE_JOB
where jobid = ? and nodeid = ? [org.apache.ode.sql]
[2011-07-15 13:32:29,839] DEBUG: executeUpdate, bound
(1,hqejbhcnphr6fpt1p71c9r) (2,hqejbhcnphr6fpt1p71c7e)
[org.apache.ode.sql]
[2011-07-15 13:32:29,839] DEBUG: close() [org.apache.ode.sql]
[2011-07-15 13:32:29,839] DEBUG: close() [org.apache.ode.sql]
[2011-07-15 13:32:29,839] DEBUG: Rollbacking on
org.apache.geronimo.transaction.manager.GeronimoTransactionManager@aa559d.
.. [org.apache.ode.scheduler.simple.SimpleScheduler]
[2011-07-15 13:32:29,839] DEBUG: Will retry the transaction in 1000 msecs
on
org.apache.geronimo.transaction.manager.GeronimoTransactionManager@aa559d
for error:  [org.apache.ode.scheduler.simple.SimpleScheduler]
org.apache.ode.scheduler.simple.JobNoLongerInDbException: Job no longer in
db: hqejbhcnphr6fpt1p71c9r nodeId=hqejbhcnphr6fpt1p71c7e
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSchedu
ler.java:516)
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSchedu
ler.java:512)
	at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSche
duler.java:284)
	at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSche
duler.java:239)
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedule
r.java:512)
	at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedule
r.java:496)
	at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.
java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
:908)
	at java.lang.Thread.run(Thread.java:619)



But when I send the first message, then wait during 2 seconds and then
send the second message, it works : scopes are COMPLETED and no exception
is logged

Any idea ?

-----Message d'origine-----
De : Alexandre SAPANEL [mailto:alexandre.sapanel@photobox.com]
Envoyé : mercredi 13 juillet 2011 18:09
À : user@ode.apache.org
Objet : RE: Parallel foreach with correlation

Thank you so much , it works !!

I had the following lines in the scope "
processItemPrintingComponentPictures"

<bpel:partnerLinks>
<bpel:partnerLink name="PictureServicePartnerBis"
		partnerLinkType="process:PictureServiceLT"
myRole="PictureServiceCallbackProvider"
partnerRole="PictureServiceProvider">
	</bpel:partnerLink>

</bpel:partnerLinks>



-----Message d'origine-----
De : Tammo van Lessen [mailto:tvanlessen@gmail.com]
Envoyé : mercredi 13 juillet 2011 17:00
À : user@ode.apache.org
Objet : Re: Parallel foreach with correlation

Hi Alexandre,

which ODE version do you use?

I could look only briefly at your example, I think it should work
actually. What you could try is moving the partnerlink declaration into
the scope within the foreach, this should actually work.

Tammo

On 13.07.2011 16:30, Alexandre SAPANEL wrote:
> Hi,
>
>
>
> I have a process which defines a parallel foreach which contains an
invoke
> and a receive with correlation. It is defined as following:
>
>
>
> …
>
> <vprop:property name=*"prodOrderId"* type=*"p:long"*/>
>
>       <vprop:property name=*"itemComponentId"* type=*"p:long"*/>
>
>       </vprop:propertyAlias>
>
>       <vprop:propertyAlias messageType=*"pim:processPictures"* part=*
> "parameters"* propertyName=*"tns:itemComponentId"*>
>
>
<vprop:query>//*[local-name()='printingComponentId']</vprop:query>
>
>     </vprop:propertyAlias>
>
>       <vprop:propertyAlias messageType=*
> "tns:processedOrderPicturesRequestMessage"* part=*"parameters"*
propertyName
> =*"tns:itemComponentId"*>
>
>
<vprop:query>//*[local-name()='itemComponentId']</vprop:query>
>
>       </vprop:propertyAlias>
>
>       <vprop:propertyAlias messageType=*
> "tns:processedOrderPicturesRequestMessage"* part=*"parameters"*
propertyName
> =*"tns:prodOrderId"*>
>
>
<vprop:query>//*[local-name()='productionOrderId']</vprop:query>
>
>       </vprop:propertyAlias>
>
> …
>
> <bpel:forEach parallel=*"yes"* counterName=*"CounterItemComponent"*
>
>                                                name=*
> "ForEach_Component_In_OrderItem"*>
>
>                                                <bpel:startCounterValue
>> <![CDATA[1]]></bpel:startCounterValue>
>
>                                                <bpel:finalCounterValue
>> <![CDATA[$nbItemComponent]]></bpel:finalCounterValue>
>
>                                                <bpel:scope name=*
> "SplitOrderItemIntoComponents"*>
>
>                                                      <bpel:variables>
>
>
<bpel:variable
> name=*"itemComponent"* type=*"dom:itemComponent"* />
>
>                                                      </bpel:variables>
>
>
>
>                                                      <bpel:sequence
name=*
> "Sequence1"*>
>
>                                                            <bpel:assign
> validate=*"no"* name=*"AssignComponent"*>
>
>
<bpel:copy>
>
>                                                                        <
> bpel:from>
>
>
> <![CDATA[$orderItem/dom:components/dom:component[position()
> = $CounterItemComponent]]]>
>
>
</
> bpel:from>
>
>                                                                        <
> bpel:to variable=*"itemComponent"*></bpel:to>
>
>
</bpel:copy
>>
>
>
</bpel:assign>
>
>                                                            <bpel:if
name=*
> "If_Printable"*>
>
>                                                                  <
>
bpel:condition><![CDATA[$itemComponent/dom:type/dom:printable='true']]></
> bpel:condition>
>
>
<bpel:scope
> name=*"processItemPrintingComponentPictures"*>
>
>                                                                        <
> bpel:variables>
>
>
> <bpel:variable name=*"processPicturesInput"*
>
>
>             messageType=*"pim:processPictures"*></bpel:variable>
>
>
> <bpel:variable name=*"processedOrderPicturesStatus"*
>
>
>             messageType=*"process:processedOrderPicturesRequestMessage"*
/>
>
>
</
> bpel:variables>
>
>                                                                        <
> bpel:correlationSets>
>
>
> <bpel:correlationSet name=*"ItemComponent"*
>
>
>
properties=*"process:itemComponentId"*></bpel:correlationSet>
>
>
</
> bpel:correlationSets>
>
>                                                                        <
> bpel:sequence>
>
>
> <bpel:assign validate=*"no"* name=*"prepareProcessPictures"*>
>
>
>             <bpel:copy>
>
>
>                   <bpel:from>
>
>
>                         <bpel:literal xml:space=*"preserve"*>
>
>
>                               <tns:processOrderPictures
>
>
>                               xmlns:tns=*"xxx"*
>
>
>                               xmlns:xsi=*"
> http://www.w3.org/2001/XMLSchema-instance"*>
>
>
>                                     <printingComponentId>23</
> printingComponentId>
>
>
>                               </tns:processOrderPictures>
>
>
>                         </bpel:literal>
>
>
>                   </bpel:from>
>
>
>                   <bpel:to part=*"parameters"* variable=*
> "processPicturesInput"* />
>
>
>             </bpel:copy>
>
>
>             <bpel:copy>
>
>
>                   <bpel:from> <![CDATA[$itemComponent/dom:id]]>
>
>
>                   </bpel:from>
>
>
>                   <bpel:to part=*"parameters"* variable=*
> "processPicturesInput"*>
>
>
>                         <bpel:query
>
>
>                               queryLanguage=*
> "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"*>
>
>
>                               <![CDATA[printingComponentId]]>
>
>
>                         </bpel:query>
>
>
>                   </bpel:to>
>
>
>             </bpel:copy>
>
>
> </bpel:assign>
>
>
> <bpel:invoke name=*"InvokeProcessPictures"*
>
>
>             partnerLink=*"PictureServicePartner"* operation=*
> "processPictures"*
>
>
>             portType=*"pim:PictureService"* inputVariable=*
> "processPicturesInput"*>
>
>
>
>
>             <bpel:correlations>
>
>
>                   <bpel:correlation set=*"ProductionOrder"*
>
>
>                         initiate=*"no"* pattern=*"response"*></
> bpel:correlation>
>
>
>                   <bpel:correlation set=*"ItemComponent"*
>
>
>                         initiate=*"yes"* pattern=*"request"*></
> bpel:correlation>
>
>
>             </bpel:correlations>
>
>
> </bpel:invoke>
>
>
> <bpel:receive name=*"ReceiveProcessPictures"*
>
>
>             partnerLink=*"PictureServicePartner"* operation=*
> "processedOrderPictures"*
>
>
>             portType=*"process:PictureServiceCallbackPT"* variable=*
> "processedOrderPicturesStatus"*>
>
>
>
>
>
>             <bpel:correlations>
>
>
>                   <bpel:correlation set=*"ProductionOrder"*
>
>
>                         initiate=*"no"*></bpel:correlation>
>
>
>                   <bpel:correlation set=*"ItemComponent"*
>
>
>                         initiate=*"no"*></bpel:correlation>
>
>
>             </bpel:correlations>
>
>
> </bpel:receive>
>
>
</
> bpel:sequence>
>
>                                                                  </
> bpel:scope>
>
>
>
>
<bpel:else>
>
>                                                                        <
> bpel:empty name=*"Empty"*></bpel:empty>
>
>
</bpel:else
>>
>
>                                                            </bpel:if>
>
>                                                      </bpel:sequence>
>
>                                                </bpel:scope>
>
>                                          </bpel:forEach>
>
>
>
>
>
> After the processPictures operation is invoked for each item in the
loop,
> ODE sends a conflictingReceive error.
>
>
>
> I found on different forums that I am not the only one having problems
with
> parallel foreach with correlation but I did not find any working
solution …
>
>
>
> Any help will be appreciated
>
>
>
> Thanks
>
>
>
> Alexandre
>

--
Tammo van Lessen - http://www.taval.de

Mime
View raw message