ADF & Multi-threading

1,280 views
Skip to first unread message

srinigenie

unread,
Jul 29, 2015, 9:08:15 AM7/29/15
to ADF Enterprise Methodology Group
Hi all,


 Multi-threading is usually inbuilt in ADF and not a widely discussed topic. However, there are interesting usecases where multi-threading could offer benefits.

One such usecase is logging the logged in user data. An application on login, stores the login time and other information about the user from the securityContext (LDAP).

This is an usecase where if we could run it in a separate thread, could save pageload time for the first landing page.

 Some notes: JSF does not support multi-threading - so that pretty much does not allow us to raise new threads from ADF UI layer. But the ADF-BC is still a layer where this looks feasible.

One anti-pattern against multi-threading on ADF-BC would be manipulating the same row across threads - example- Changing the current row of a VO's default Iterator.

I thought of discussing the pros and cons of multi-threading in ADF in this forum.

hasim syed

unread,
Jul 29, 2015, 4:22:40 PM7/29/15
to adf-met...@googlegroups.com
Oracle should have taskflow property which should enable multiple threading and save the time going out of framework. 

On Wed, Jul 29, 2015 at 2:53 PM, hasim syed <hsa...@gmail.com> wrote:
We did multithreading when our home page was dashboard page consisting of 8-9 Taskflows where each taskflow SQL was called in 
concurrent manner using Weblogic WorkManager. so instead of page load of 3 secs * 10 = 35 seconds. It took 5 seconds to load 
dashboard with 8-9 taskflows.

--
--
You received this message because you are subscribed to the ADF Enterprise Methodology Group (http://groups.google.com/group/adf-methodology). To unsubscribe send email to adf-methodolo...@googlegroups.com

 
All content to the ADF EMG lies under the Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/). Any content sourced must be attributed back to the ADF EMG with a link to the Google Group (http://groups.google.com/group/adf-methodology).

---
You received this message because you are subscribed to the Google Groups "ADF Enterprise Methodology Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adf-methodolo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jobinesh Purushothaman

unread,
Jul 29, 2015, 8:50:55 PM7/29/15
to adf-met...@googlegroups.com
ADF BC is not thread safe.

--

Duncan Mills

unread,
Jul 30, 2015, 3:38:08 AM7/30/15
to adf-met...@googlegroups.com
++1 with Jobinesh here.

1) ADFBC is not thread safe
2) Even if you’re not using ADF BC, There are are so many things in JSF that could be messed up by multi-threaded access that you are asking for trouble 
3) Just think about what happens in a failover situation 

If you are going to do anything asynchronous then look at using the WebLogic Work Manager

Duncan Mills

John Flack

unread,
Jul 30, 2015, 8:17:52 AM7/30/15
to adf-met...@googlegroups.com

We have done asynchronous work in the database by having a method in the application module implementation class that kicks off a DBMS_SCHEDULER job.  It is great for batch processing – the ADF application lets the user upload a file, then it schedules a job to process it.  The job queues some events that a poll component reads to let the user watch the job progress, IF he/she wishes.  But the user can also go to another part of the application and keep working and return later to see if the job is done, or even log out entirely, and the job keeps running.

Luc Bors

unread,
Jul 30, 2015, 8:24:55 AM7/30/15
to adf-met...@googlegroups.com
Hi all,
agreed, ADF BC is not thread safe and as Duncan states, for doing asych work, one should look at the Weblogic Work Manager.
However, Jobinesh has a great post ( http://www.jobinesh.com/2013/07/using-java-ee-apis-for-asynchronously.html )  on asynchronously calling ADF BC Application Modules by simply wrapping the application method call in an asynchronous EJB method.

Wondering how you guys see this blog post in context with this group thread ?

Thanks

Steven Janssens

unread,
Jul 30, 2015, 8:47:17 AM7/30/15
to adf-met...@googlegroups.com
We did some (ADF BC) batch processing by offloading it to a separate Java Thread in the ADF BC Layer.
The seperate thread always instantiates a new ADF BC Root Application Module and releases it when the work is done.
It is recommended to use a thread pool to manage/limit the number of threads launched simultaneous.

We can not use any db vendor specific solutions since our product runs on top of both Oracle and DB2.

Important: In the Java EE ecosystem it is considered a bad practice to launch your own threads, since they are not managed by the Java EE server and can lead to instability (for example when resources aren't properly released).

Regards,
Steven.


Van: "John Flack" <Jo...@smdi.com>
Aan: adf-met...@googlegroups.com
Verzonden: Donderdag 30 juli 2015 14:17:48
Onderwerp: RE: [ADF EMG] ADF & Multi-threading
--
Reply all
Reply to author
Forward
0 new messages