>From the stack trace above,
at
org.jbpm.bpel.def.ProcessInstanceStarter.visit(ProcessInstanceStarter.java:82)
the process instance is starting, no transaction has been committed and the
partner link instances are still transient.
A different approach to fix the problem is assigning an ID to the transient
instances:
public PortConsumer getPortConsumer(PartnerLinkInstance instance) {
| Long instanceId = new Long(getOrAssignId(instance));
| PortConsumer portConsumer;
| synchronized (portConsumers) {
| // retrieve cached port consumer
| portConsumer = (PortConsumer) portConsumers.get(instanceId);
| if (portConsumer == null) {
| // no cached consumer, create one from partner endpoint reference
| EndpointReference partnerRef = instance.getPartnerReference();
| if (partnerRef == null) {
| // no partner reference, create one containing only the port type
as selection criterion
| partnerRef = createPartnerReference(instance.getDefinition());
| instance.setPartnerReference(partnerRef);
| log.debug("initialized partner reference: instance=" + instance +
| ", reference=" + partnerRef);
| }
| // select a port from the service catalog with the criteria known
at this point
| Port port = partnerRef.selectPort(getServiceCatalog());
| log.debug("selected partner port: instance=" + instance + ", port="
+ port.getName());
| // create a consumer for that port
| portConsumer = new PortConsumer(port);
| portConsumers.put(instanceId, portConsumer);
| }
| }
| return portConsumer;
| }
The code for assigning an identifier is simply:
private static long getOrAssignId(PartnerLinkInstance instance) {
| long instanceId = instance.getId();
| // in case instance is transient, assign an identifier to it
| if (instanceId == 0L) {
| Services.assignId(instance);
| instanceId = instance.getId();
| }
| return instanceId;
| }
I introduced getOrAssignId() because RelationContext has another method that
uses a potentially transient partner link instance:
private static Object createKey(PartnerLinkInstance partnerLinkInstance,
| Operation operation, String messageExchange) {
| return new OutstandingRequest.Key(getOrAssignId(partnerLinkInstance),
| operation.getName(), messageExchange);
| }
It'd be great if you could try these other fixes too.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3954239#3954239
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3954239
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user