Skip to main content

Transaction handling in Application Module when used in JTA context

When Application Module is used inside the JTA transaction enabled  method( i.e when  AM method is exposed as web service or called inside a WebService or EJB with declarative transaction), framework takes a different execution path for the 'post-commit' activities such as entity cache clean up. In such case, framework use ServiceJTATxnHandlerImpl for handling the transaction and  the entity cache clean will happen only after finishing the transaction that is initiated by the calling  method(when the call returns from the wrapping service method), not right after the commit call on DBTransaction. If you want immediate clean up and does not need a global transaction management, then mark  the service method with no transaction as: @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) . This will make AM to use DefaultJTATxnHandlerImpl (as you see in normal scenario). 

Comments

Popular posts from this blog

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 !!!

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…