Hi Wes. Here is a really great book you should read which will answer all your questions:
--
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).
01/13/2010 AM pools vs Bounded Task Flows
https://forums.oracle.com/forums/thread.jspa?messageID=4022731
I believe this is the thread that started all of your inquiries regarding AMs (now on my mind as well), TF transaction & DC control. Below are excerpts for some really important factors for me to consider if I choose to use RootAM with nested AM in 11g.
From your posts:
“…a root AM can be defined in the Common project that can be used by the BTF workspaces, where the BTF workspace can import the AM… then nest it's own AM under the root AM from the Common project.”
“…The AM Wizard/Editor only allows the root AM to nest the child AMs, not the other way around. At design time as the root AM isn't available to the BTF workspace to be opened/edited, there's no way to declaratively to tell the root AM to nest the BTF AM …”
Yeap, I thought about this too and from my brief interaction with the IDE, this is still not possible.
From Steve’s posts:
“The problem (I believe he is referring to auto nesting of AMs) with the current mechanism is that depending on whether an AM is referenced first, or referenced subsequently as part of a called task flow, it will either be used as a top-level root AM or a nested AM. This means that its AM pooling parameters only effect the case where it's a top-level AM, and have no effect when its used as a nested AM since it's nested inside some other top-level AM.”
“…In case #2, AppModuleTwo AM instance is created as a nested AM inside AppModuleOne. In this case, the AM pool involved is the nesting/parent AM's AM pool, not the nested/child's AM pool.”
10/12/2011 Angels in Architecture
The different approaches to setting up app/project structure described in this presentation is what I will base our future 11g app on. Our 10g production app falls under the simple “Single Application” approach. All AMs are nested under a RootAM. Developers drag/drop the nested AM DataCtonrols for their modules. I encountered the same issues you described in the presentation as the project grew (now in production for 6 years).
What I like (or perhaps become accustomed to) about this structure is a single point of config for AM Pool, for example, AM Pool is turned off for testing deployments and we have a handful of bc4j config parameters tweaked at a single point. (However, I also realize that one of the benefits of having individual AM Pool configs is that user traffic to each biz module varies as per Steve’s point from the above OTN thread.)
From this presentation, I choose to research further how to establish a “Multi Master App with Multi BTF App”. The reason being is originally our app only supports internal data collection, however, now a big aim in the community is for open collaboration and multicenter clinical trials. Our app obviously has to support this institutional goal. This translates to “Multi Master App”, where we need to deploy flavors of our internal app onto the internet so different hospitals can access our system.
4/20/2011 Designing task flows for reuse – data control scope & transaction options
https://groups.google.com/forum/?fromgroups=#!topic/adf-methodology/-U8wyOm-38w
Keeping in mind of TF reuse consideration. You suggest using “Use Existing Transaction if Possible” and Shared properties set. (because the calling parent TF might want to use the child BTF either in its own isolated& Always begin new transaction OR shared and use existing transaction.
5/17/2011 JDev 11g, Task Flows & ADF BC – the Always use Existing Transaction option – it's not what it seems
http://one-size-doesnt-fit-all.blogspot.com/2011/05/jdev-11g-task-flows-adf-bc-always-use.html
Experiment:
BTF1 settings–
Transaction: “Always begin new transaction”
DC: “Isolated”
BTF2 settings–
Transaction: “Always Use Existing Transaction”
DC scope: “Shared”
Flow:
BTF1 -> BTF2
Result after running BTF1. :
AM/Connection not created on page from BTF1. However, navigate to BTF2 and even though the settings above should throw an exception.
Conclusion:
ADFc does not directly control ADFbc. Although BTF1 is marked to begin a new transaction, its not until BTF2 actually executes bindings (even though its marked “always use existing transaction…”), is when the transaction is actually created. This was a good peak under the hood of ADFc & ADFbc interaction, more importantly, setting “Always use existing transaction” on BTFs does not put a constraint on the developers just as long as a parent BTF marks up a new transaction (flag).
5/17/2011 JDev 11g, Task Flows & ADF BC – one root Application Module to rule them all?
http://one-size-doesnt-fit-all.blogspot.com/2011/05/jdev-11g-task-flows-adf-bc-one-root.html
Experiment 1:
2 RootAM used individually in each BTF.
BTF1 setting:
Transaction setting: “No Controller Transaction”
DC “Shared”
BTF2 setting:
Transaction setting: “No Controller Transaction”
DC scope: “Shared”
Flow:
UTF1 -> BTF1
UTF1 –>BTF2
Result: Two separate transactions, one for each RootAM. DC marked “Shared” does not effect on behavior of connection.
Experiment 2:
Same setup from experiment 1 but BTF2 uses “Always use existing Transaction” for Tx setting. Also,
BTF1 now flows to BTF2.
Result: AM in both BTF1 and BTF2 becomes automatically nested under a single Root at runtime. VO instances in respective AM shares entity cache but currency is not preserved as expected since its two separate instances of the same VO class.
Conclusion:
Experiment 1 is basically how our 10g app is structured. No BTF control of transaction. All AMs are nested under a single RootAM. If a developer forgets to nest, a separate session to the db is created and errors will be reported at runtime because the db role is only set in afterConnect() in RootAM (no privileges to views).
Experiment 2 demonstrates auto nesting of AMs in 11g via BTF transaction/dc flags. You go on to references Steve’s reply on how if parent BTF calls a child BTF with two separate RootAMs will result in the RootAM from the child BTF being auto nested under the parent BTF’s RootAM. Pretty neat! Also he goes on to say that the AM pool is from the parent BTF’s RootAM.
Key points
1. Do not rely on the fact the auto nesting behavior will be constant. Imagine your AM to be nested randomly.
2. Do not mix “No controller transaction” with other ADFc transaction flags on BTFs.
3. Transaction behavior might be different for EJBs, PoJos etc. (I’ll keep this in mind when I have to build WS).
So, for now, my dichotomize options…
If I choose the RootAM path, how can I solve this issue you raised?
“…The AM Wizard/Editor only allows the root AM to nest the child AMs, not the other way around. At design time as the root AM isn't available to the BTF workspace to be opened/edited, there's no way to declaratively to tell the root AM to nest the BTF AM …”
If I choose the auto nesting via BTF path, I need to build a single BTF which will be the point of entry where a connection is opened via marking it “Always use new transaction”. In subsystem (apps that developers create), all BTFs should be marked “Always use existing Transaction” or “Always use existing transaction, if possible”. The AM from the MasterApp’s BTF will be the “RootAM”, I can still overwrite the afterConnect() to for set db role. What about the AM pool settings? E.g. AM Pool On/Off, initial size, etc.. Does that get inherited? Will Dynamic JDBC credentials still work?
Thanks!
-Wes