Skip to main content

Calling Application Module Methods from EJB and MDB

Sometime back I blogged about using JMS with ADF BC http://jobinesh.blogspot.com/2011/04/using-jms-with-adf-business-components.html . I'm revisiting this topic with another example illustrating the usage of application module methods from EJB and MDB. The sample uses XA Data source which will help you to force both AM and EJB to share same db transaction. Note that,  I'm calling ApplicationModule::postChangesToDB() to post changes to database when AM method is used inside EJB method, leaving the 'commit' call to the underlying container.


Download

You can download the sample workspace from here.Refer the previous post for setting up the MDB used in the sample + Configure XA Datasource with JNDI name jdbc/HRDS
[Runs with Oracle JDeveloper 11g R2 PS1 + HR Schema]

Comments

Popular posts from this blog

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!