java - concurrent threads for a method of EJB -



java - concurrent threads for a method of EJB -

i have stateless ejb method process data. method works 5..20 seconds

i need have 10 threads, executes method concurrently. made annotation method @schedule(second = "*", min = "*", hr = "*") container (glassfish 4) launches 1 thread method.

i tried utilize annotation @asynchronous, create no effect

what should do?

write sec class using @schedule(second = "*", min = "*", hr = "*") phone call @asynchronous ejb method - then, if duration said, should start new thread every second.

minimal example caller.java public class caller { @ejb asyncejb asyncejb; @schedule(second = "*", min = "*", hr = "*") public void call() { this.asyncejb.call(); } } asyncejb.java @stateless public class asyncejb { @asynchronous public void call() { // long running stuff. } }

java concurrency ejb

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -