Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

accessing a single AM in a multi-thread environment

Lovin_JVMay 22 2017 — edited May 26 2017

hi my jdev version - 11.1.1.7,

I have an adf application where I have to process some data and update the data in a table but implementing multithread. I just invoke this scenario on click of a button which reads list of data from UI and initiates processing of data using multi thread. After the each record is processed, its updated in database programmatically through an operation defined in AM.

Below is code to access AM inside call() of java.util.concurrent.Callable:

        String amDef = "com.project.model.am.AppModule";//package of AM

        AppModuleImpl am = null;

        try {

            String config = "AppModuleLocal"; //Name of Local AM in

            am =

(AppModuleImpl)Configuration.createRootApplicationModule(amDef, config);

            am.updateTable();

Based on Jobinesh's blog Binaries: What you may need to know while calling Application Module methods from Java EE components such as  EJB and MD…  we have added ServletADFFilter in web.xml

Few intermittent issues on cluster and non-cluster env :

1.oracle.jbo.AlreadyLockedException: JBO-26092

2.VO which is used to update the table has a view criteria having promary key as bind variable, but we dont get rows on executing the criteria.

Any suggestion on how can we improve on above implementation? DO we have any alternative to update DB using through AM in  multi-threading processing without getting above issues?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2017
Added on May 22 2017
10 comments
595 views