EJB-Wildfly: Is it fine to execute multiple EJB Scheduler in Wildfly or should i keep it in separate Class files? - singleton

There are 10 scheduler of this type in same Class file:
#Startup
#Singleton
#AccessTimeout(value = 1, unit = TimeUnit.HOURS)
public class MeowPoller {
#Schedule(hour = "02", minute = "00", persistent = false)
public void runFetchApplications() {
When some job stuck for say 3 hours then next job does not execute till this job finish.
System keeps on giving:
2020-01-20 01:02:00,001 WARN [org.jboss.as.ejb3.timer] (EJB default - 6) WFLYEJB0043: A previous execution of
timer [id=459875b7-5346-40c1-a9a0-f36dec8ef53d timedObjectId=Meow-1.6-SNAPSHOT.Meow-1.6-SNAPSHOT.MeowPoller
auto-timer?:true persistent?:false timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl#7ffe6c6a
initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Mon Jan 20 01:02:00 CET 2020 timerState=IN_TIMEOUT
info=null] is still in progress, skipping this overlapping scheduled execution at: Mon Jan 20 01:02:00 CET 2020.

Related

APScheduler python: my scheduled job is running multiple times on same timeslot

job_stores = {
'default': MongoDBJobStore(database=databasename,
client=clientname, collection="schedulejob")
}
executors = {
'default': {'type': 'threadpool', 'max_workers': 5}
}
job_defaults = {
'coalesce': True, # When the same task is triggered multiple times at the same time, it runs only once
'max_instances': 3,
'misfire_grace_time': 3600, # The task is still executed after 30 seconds of expiration
}
global sched
sched = BackgroundScheduler(jobstores=job_stores, executors=executors, job_defaults=job_defaults, daemon=True)
sched.add_job(helloworld, 'interval', hours=3, args=(),
name=name)
I can see schedulejob is created with single entry, but on respective timestamp, my same function helloworld got executed four times.
Note: I am using Flask server with 4 nodes. Is the four nodes being the reason.

delay in arrayList processing vs String processing

Hello I have a question concerning data processing in groovy.
I have a groovy step in which I call a method that gives me a list of json in return, then I parse it to test a value
here is the code :
props = get_device_properties(device_id)
log.info "props = $props"
log.info "size " + props.size()
log.info "class " + props.class
//props = jsonSlurper.parseText(props)
log.info "***************************** t1"
props.find(){
log.info it.name
// check the field songTitle
if (it.name == "songTitle")
{
// first check media
if(init_correct == false)
{
log.info "init = " + it.value
if (it.value == "UNKNOWN")
found == true
log.info "***************************** t2"
here is a log of the process :
Tue Jan 28 11:34:56 CET 2020: INFO: props = [[satisfied:true, href:...
Tue Jan 28 11:35:03 CET 2020: INFO: size 31
Tue Jan 28 11:35:03 CET 2020: INFO: class class java.util.ArrayList
Tue Jan 28 11:35:03 CET 2020: INFO: ***************************** t1
Tue Jan 28 11:35:03 CET 2020: INFO: songTitle
Tue Jan 28 11:35:03 CET 2020: INFO: init = Sad But True
Tue Jan 28 11:35:03 CET 2020: INFO: ***************************** t2
If I parse the map directly there is a gap of time between method return and start of the next processing :
t2 - t1 is around 7s
If 'get_device_properties' returns a String instead of the arrayList and I do a parseText (uncomment the 5th line) on this string, I don't have the extra processing time before I can parse the map
Tue Jan 28 11:35:39 CET 2020: INFO: props = [{"satisfied":true,"href":...
Tue Jan 28 11:35:39 CET 2020: INFO: size 25138
Tue Jan 28 11:35:39 CET 2020: INFO: class class java.lang.String
Tue Jan 28 11:35:39 CET 2020: INFO: ***************************** t1
Tue Jan 28 11:35:39 CET 2020: INFO: songTitle
Tue Jan 28 11:35:39 CET 2020: INFO: init = Sad But True
Tue Jan 28 11:35:39 CET 2020: INFO: ***************************** t2
t2 - t1 = 0
can anyone help me to understand why this happens ?
indeed, I usually tend to use the most straightforward way to implement my script ...

.getcurrentrow (DCIteratorBinding) is returning null after an hour

I am new in ADF (EJB/JPA not Business Component), when the user is using our new app developed on jdeveloper "12.2.1.2.0", after an hour of activity, system is loosing the current record. To note that the object lost is the parent object.
I tried to change the session-timeout (knowing that it will affect the inactivity time).
public List<SelectItem> getSProvMasterSelectItemList(){
List<SelectItem> sProvMasterSelectItemList = new ArrayList<SelectItem>();
DCIteratorBinding lBinding = ADFUtils.findIterator("pByIdIterator");/*After 1 hour I am able to get lBinding is not null*/
Row pRow = lBinding.getCurrentRow();/*But lBinding.getCurrentRow() is null*/
DCDataRow objRow = (DCDataRow) pRow;
Prov prov = (Prov) objRow.getDataProvider();
if (!StringUtils.isEmpty(prov)){
String code = prov.getCode();
if (StringUtils.isEmpty(code)){
return sProvMasterSelectItemList;
}else{
List<Lov> mProvList = getSessionEJBBean().getProvFindMasterProv(code);
sProvMasterSelectItemList.add(new SelectItem(null," "));
for (Lov pMaster:mProvList) {
sProvMasterSelectItemList.add(new SelectItem(pMaster.getId(),pMaster.getDescription()));
}
}
}
return sProvMasterSelectItemList ;
}
I expect to be able to read the current record at any time, specially that it is the master block, and one record is available.
This look like a classic issue of misconfigured Application Module.
Cause : Your application module is timing out and releasing it's transaction before the official adfc-config timeout value.
To Fix :
Go to the application module containing this VO > Configuration > Edit the default > Modify Idle Instance Timeout to be the same as your adf session timeout (Take time to validate the other configuration aswell)

React-big-calendar - sort(set order) allDay events

React big calendar receives an array with objects:
allDay: true
end: Sat Jan 13 2018 03:03:00 GMT+0200 (EET) {}
eventType: "video"
start: Sat Jan 13 2018 03:03:00 GMT+0200 (EET) {}
title: "0"
There can be 3 types of EventType - video, duration and audio,
but they are displaying completely in random order.
Image
Need an advice how to set an order?

TomEE disable TransactionManager defaultTransactionTimeout?

Is there a way to disable the timeout wihtout getting rid of the transaction manager in TomEE?
My sample transaction manager from tomee.xml is:
<TransactionManager id="MyTransactionManager" type="TransactionManager">
adler32Checksum = true
bufferSizeKb = 32
checksumEnabled = true
<!--defaultTransactionTimeout = 10 minutes-->
defaultTransactionTimeout = 10000 minutes
flushSleepTime = 50 Milliseconds
logFileDir = txlog
logFileExt = log
logFileName = howl
maxBlocksPerFile = -1
maxBuffers = 0
maxLogFiles = 2
minBuffers = 4
threadsWaitingForceThreshold = -1
txRecovery = false
</TransactionManager>
But sometimes the transaction can be longer than 10000 minutes (~ 7 days).
TomEE version 1.7.4
7 Days? Holy smokes! What on earth are you doing? :D
Unfortunately if you remove it, it will go back to the default. However, you could simply put the following which would work just fine:
<TransactionManager id="MyTransactionManager" type="TransactionManager">
...
defaultTransactionTimeout = 10 days
...
</TransactionManager>
Alternatively you can wrap your code invocation with a bean setting the duration for that particular case using UserTransaction: http://docs.oracle.com/javaee/6/api/javax/transaction/UserTransaction.html#setTransactionTimeout(int)