Apache ODE - BPEL compensation handler - weird behavior (or may be I'm wrong somewhere - handler

I've got this example of BPEL from this location https://svn.wso2.org/repos/wso2/carbon/platform/trunk/products/bps/modules/samples/product/src/main/resources/bpel/2.0/SampleCompensationHandlers/FlightReservationProcess/
The example sets a given variable when executes a given scope.
The last scope throws an error, so the fault triggers the relevant handler for that scope, which rethrows the fault. That way the fault handler for the process is triggered, where the compensation is made for every successfully completed scope.
I've created a BPEL project in Eclipse and I've put the example in there, then I've started some tests. But I've found a very strange behavior:
I've got correct results just few times:
CarReservationActivity: 1 CarReservationCompensated: 1 HotelReservationActivity: 1 HotelReservationCompensated: 1 FlightReservatoinActivity: 1
In all other cases I've got incorrect results:
A)
CarReservationActivity: 1 CarReservationCompensated: 0 HotelReservationActivity: 1 HotelReservationCompensated: 1 FlightReservatoinActivity: 1
B)
CarReservationActivity: 1 CarReservationCompensated: 1 HotelReservationActivity: 1 HotelReservationCompensated: 0 FlightReservatoinActivity: 1
And when the result is incorrect then the case A) dominates.
I can not find out where is the problem. Everything looks fine.
Can someone help me to solve the issue ?
Used software :
- Windows 7 Enterprise, SP1, 32bit
- Apache Tomcat v.6.0.18
- Apache ODE v.1.3.5
- Eclipse Indigo v.3.7.2 SR2
- BPEL designer v.1.0.1
- Java 7 (v.1.7.0_07)

Related

Cronos cron Service Working Cron Job Demo net core 5

I'm using the Cronos ServiceWorkerCronJobDemo ( https://github.com/dotnet-labs/ServiceWorkerCronJob )
In a Dot Net Core 5 application
As it stands it works as expected.
But as soon as I start to change the cron expression to what I need "0 0 1 * *" or #monthly
I need it to be schedule to run on the first of the month.
I get an invalid value for the interval error.
Does anyone have a solution?
screen dump of error
screen dump of settings
Your cron expression doesn't seem to find any problems, and I can parse it out with it.
Can you show the specific error and related code?
I have reviewed three articles, which may be helpful to you:
1.Cronos
2.Cron job troubleshooting guide
3.Schedule Cron Jobs using HostedService in ASP.NET Core

Karate - Multi threaded access requested - issue

I have 100+ tests being covered in 25+ feature files and I have the karate-config.js which has 3 "karate.callSingle" functions as below.
config.weatherParams = karate.callSingle(
"file:src/test/java/utils/AvailableForecasts.feature",
config
);
config.routingParams = karate.callSingle(
"file:src/test/java/utils/CalculationInput.feature",
config
);
config.vesselParams = karate.callSingle(
"file:src/test/java/utils/VesselStatus.feature",
config
);
Same issue when I use classpath inside callSingle.
When I run all the tests at once with parallel (tried randomly 1-100 threads) enabled, I get the following error:
org.graalvm.polyglot.PolyglotException: Multi threaded access requested by thread Thread[pool-2-thread-8,5,main] but is not allowed for language(s) js.
- com.oracle.truffle.polyglot.PolyglotEngineException.illegalState(PolyglotEngineException.java:132)
- com.oracle.truffle.polyglot.PolyglotContextImpl.throwDeniedThreadAccess(PolyglotContextImpl.java:727)
- com.oracle.truffle.polyglot.PolyglotContextImpl.checkAllThreadAccesses(PolyglotContextImpl.java:627)
- com.oracle.truffle.polyglot.PolyglotContextImpl.enterThreadChanged(PolyglotContextImpl.java:526)
- com.oracle.truffle.polyglot.PolyglotEngineImpl.enter(PolyglotEngineImpl.java:1857)
- com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:104)
- com.oracle.truffle.polyglot.PolyglotMap.entrySet(PolyglotMap.java:119)
After playing around with multiple combinations- surprisingly, when I have only 2 "callSingle" functions in karate.config (commenting VesselStatus.feature) then it works fine.
All these 3 "callSingle" things calling 3 different services and sets the variable for other tests to run, so these 3 are critical.
Is there a way, we can re-optimize / bring a different approach to avoid the above issue?
This is a known issue that should be fixed in 1.1.0.RC2
Details here: https://github.com/intuit/karate/issues/1558
Would be good if you can confirm.
I faced this issue in my karate implementation #peter-thomas. I just got an easy workaround for this issue since we know that graalVM js engine doesnt support multithreading of karate-config.js
work around is - we can wait for a certain milliseconds and that milliseconds has to be genrated randomly.
below code inside karate-config.js have a look please -
function fn(){
// karate-config essential coding
var random_millis = Math.floor(Math.random() * 5000 - 1000 +1 )) + 1000;
java.lang.Thread.sleep(random_millis);
return something;
}
with above piece of code i tried my 100+ feature files running with 20 parrellal threads with karate 1.2.0.RC1 and it worked fantastically fine.
How its working - all the 20 threads will jump altogether , reaching karate-config at the same time. but if we apply some delay that too random between 1 to 5 seconds (in millis) , all threads will wait for different time avoiding multithreading issue.
I also know that between 1 to 5000 millisends , still there are suppose 1% chances that we get same numbers but till we get concrete solution of this issue i guess we can use this workaround.
Thanks,
Saurabh

Inconsistent behavior of Quartz2 scheduler in Apache Camel

I have an Apache Camel project that is using Quartz2 as the scheduler. The requirement is to make it a cluster. The code is deployed to weblogic 12c. the quartz is configured as per many samples with clustering enabled.
This is my properties file (without the datasource)
org.quartz.scheduler.instanceName = MyScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.skipUpdateCheck = true
org.quartz.scheduler.jobFactory.class = org.quartz.simpl.SimpleJobFactory
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.useProperties=true
org.quartz.JobBuilder.requestRecovery=true
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
When I deploy and start both nodes I see that the QRTZ_SCHEDULER_STATE table has extra entry for one of the nodes:
MyScheduler-routerContext server_node21567108546690
MyScheduler-routerContext-1 server_node11565896495100
MyScheduler-routerContext-1 server_node11567108547295
And I am guessing because of that the one node is being called once in a while while the other node gets called all the time (so occasionally both nodes are invoked at the same time).
I have tried to do a clean restart of weblogic nodes but the issue is still there
This is how my route(s) look like:
from("quartz2://provRegGroup/createUsersTrigger?cron={{create_users_cron}}&job.name=createUsersJob")
.routeId("createUsersRB")
.log("**** starting check for create users");
//where
//create_users_cron=0+0,5,10,15,20,25,30,35,40,45,50,55+*+*+*+?
//expecting one node being called by the scheduler at a time..
I figured out what caused the issue. apparently there were orphan weblogic processes that were running on one (or even both nodes) - this would be a question to our tech archs - why this was such a mess.. ps was showing two weblogic servers running on a node - one that I started recently and one that was there for say a month..
expecting this would never happen to production environment I assume the issue has been resolved..

Does exception handling in Clarion exist?

Does Clarion 8 offer anything for exception handling? I know as of Clarion 5 there was no support for things like try / catch but that was released almost 10 years ago. I can't seem to find any info on how to recover from exceptions in C6 to C8 unless I was using Clarion# (aka Clarion.NET) which I'm not. If there's definitely nothing like try / catch, are there any tricks or hacks that can be used to not have a program crash when an exception is thrown even if it goes unhandled?
If it helps, I'm using version 8.0.0.8778.
EDIT 1:
Here is some sample code for a basic program that should supposedly illustrate the feature PROP:LastChanceHook, however, I can't get it to work. When I run this program, I see the first message "Start", but then nothing happens. I've tried returning 0 or 1 from Hook but that hasn't made a difference either. Every time I run this, I have to go onto the Task Manager and end the process for the program because it's not being killed.
PROGRAM
INCLUDE('CWEXCPT.INT'), ONCE
MAP
Hook(*ICWExceptionInfo), LONG
Test(LONG,LONG)
END
CODE
MESSAGE('[Sample] Start')
SYSTEM{PROP:LastChanceHook} = ADDRESS(Hook)
Test(10, 0) ! Intentionally causes an exception
MESSAGE('[Sample] After Test')
RETURN ! Tried removing this, no difference
Hook PROCEDURE(*ICWExceptionInfo info)
CODE
MESSAGE('[Sample] Start Hook')
IF info &= NULL THEN RETURN 0 END
Message('An exception!')
RETURN 1 ! 0 = don't kill, anything > 0 = tell RTL to kill the thread
Test PROCEDURE (LONG a, LONG b)
CODE
a %= b
Yes, take a look at prop:LastChanceHook in the help. It may provide enough function for your needs.
In other cases, the info at this link might also be useful:
http://clarionsharp.com/blog/tracking-down-those-pesky-gpfs/
In the next public build of C8 (it's presently Sept 27, 2012), the buttons on that exception display (shown at the link above) can be customized a bit.

GenerateResource / CoreResGen suddenly taking almost 30 times as long

Starting a few weeks ago, compiling a project (VB.NET, .NET 2.0, VS 2010) has taken several times as long as before. In Task Manager, I noticed ResXtoResources.exe taking lots of CPU for a while. I've finally been able to get some data on this using MSBuild's 'Diagnostic' output setting, and comparing that output to what I see in a branch from a few months back. Most striking are the final lines, which give timings. Before:
Target Performance Summary:
[..]
1395 ms CoreResGen 1 calls
1930 ms CompileLicxFiles 1 calls
2135 ms GenerateApplicationManifest 1 calls
2844 ms CoreCompile 1 calls
Task Performance Summary:
[..]
1391 ms GenerateResource 1 calls
1929 ms LC 1 calls
2134 ms GenerateApplicationManifest 1 calls
2843 ms Vbc 1 calls
Build succeeded.
Time Elapsed 00:00:09.50
========== Rebuild All: 5 succeeded, 0 failed, 0 skipped ==========
After:
Target Performance Summary:
1348 ms CompileLicxFiles 1 calls
1747 ms GenerateApplicationManifest 1 calls
2595 ms CoreCompile 1 calls
39575 ms CoreResGen 1 calls
Task Performance Summary:
1347 ms LC 1 calls
1745 ms GenerateApplicationManifest 1 calls
2593 ms Vbc 1 calls
39570 ms GenerateResource 1 calls
Build succeeded.
Time Elapsed 00:00:47.34
========== Rebuild All: 5 succeeded, 0 failed, 0 skipped ==========
Both projects were compiled on the same system with the same settings. We've made numerous changes, to be sure, but nothing to the order of magnitude that would justify such a change in timings (and only for this one task!). I assume resource generation is getting stuck on something — a circular reference, a missing one, etc. I have been unable, however, to find anything useful on how to trace such a problem down to what I assume is just a single resource file.
Short of looking through thousands of checkins or temporarily removing some forms (and thus, their resource files) from the project, is there anything else I can do to figure out the issue? I can't seem to find individual per-resource file timings.
Findings so far:
I've created a new, empty project with all the same .resx files in place.
The issue is not reproducible in .NET 4.0: compiling the exact same test project takes less than a second.
The issue is reproducible in .NET 2.0 as soon as I also add one of the forms from the original project; apparently, it will otherwise not compile the resources "properly".
Removing individual .resx files will reduce the timings 'proportionally'; that is: I have unfortunately not found a single file that is the culprit.
Looks like this blog entry gives the answer.
In a nut, search your .resx files for assembly references that don't actually exist (such as System.Windows.Forms, Version 4.0.0.0), and replace them with ones that do (Version 2.0.0.0). I used grepWin to accomplish this.
My CoreResGen / GenerateResource timings are now roughly what they used to be. CruiseControl.NET says build time is down from 92 seconds to 40. :)
I found the reason here... the resources contained a png file save in special Adobe Fireworks format (PNG). I exported the file to png (without layer information) and now the compile takes 6 seconds.