Shared applications modules

Hi,
I've been reading the section about shared AM in the developer's guide, however I found explanations rather incomplete.
I would like to know how to do the following:
1. Use a shared AM from the user interface, a.k.a. have a data control referring to an application or session scoped shared AM. I am aware that I can change the configuration name in the DataBindings.cpx file, however there are no ways to specify the instance name as defined in the "Model" project Business Components properties.
2. Use a shared AM from another AM, a.k.a. define a nested AM as a reference to an application or session scoped shared AM. Inspecting the source xml file for an AM definition, I see that nested AM are defined as AM usages, a.k.a. like a shared AM definition is an AM usage. So, if I specify the usage name of a shared AM and change the "SharedScope" to be "1" (session) or "2" (application), will it work as I expect it?
3. Use a shared AM from code. In this case, I would like to known how to retrieve an instance of a shared AM from its instance name wherever my code is located. I may be in an EntityObject, ViewObject or elsewhere.
4. How do I create dynamically a shared AM instance? Either as a nested AM from a root AM or from scratch (if that is possible).
Shared AM looks like an extremely nice feature, let us exploit them! :-)
Thanx!
Olivier

Thank you for your answer Blaise.
I agree that creating shared AM dynamically seem to contradict their purpose, but I'm really looking to know how things work and where I can push that feature.
I hope you found out how we can access shared AM with code as it seems to me that the feature is completely underexploited.
What if I'd like to "cache" other stuff at the AM level?
What if I'd like to access a shared AM from another AM to access shared data?
What if I'd like to show in my UI a drop-down with cached lookup data and I can't use the LOV feature?
I can think of plenty of scenarios where I would use it.
Thanx!
Olivier

Similar Messages

  • View Objects in the shared application module is not refreshing

    Hi ,
    I have view objects defined shared apps module. This view objects are used for creating lovs which won't change very frequently. I have set the AutoRefresh=true for this view objects. I do have a UI to update the underline table for these lovs. The view objects defined in the shared application module is not getting reflected even I add a new value in the database. Is there any way to refresh these lovs as soon as its added to db?
    Thanks
    Suneesh

    I will explain my scenario ;
    I have a view object(ViewA) where I have defined many LOVs for different attributes. Thes LOVs are using the shared application module's view object (shared_view1,shared_view2...etc) as List DataSource. Where exactly I need to set the auto refresh property=true. Currently I have set all of my shared apps view objects's(shared_view1,shared_view2...etc) autorefresh property=true.Do I need to use the autorefresh =true in the ViewA ?
    What is the concept of autorefresh=true ? Wiill it refresh automatically the view object nexttime i am accessing the page after the db inserts ? Is there any time delay there ? if there is it something configurable ?
    Thanks
    Suneesh

  • Verifying a Shared Application Module

    I have been looking at Shared Application Modules; I have created a small test application that utilizes a Shared Application Module. I would like to ensure that my implementation is OK, e.g., verify that only one instance of the Shared Application Modules is created. How can I do this?
    In some forum, someone said that he tried to do this by “monitor the Application Pool “. How do I do this?
    Thanks

    You can test this from the AM tester. Enable Debugoutput to Console as described here.
    IF you use a VO instance from a shared AM as an LOV you will see the LOV query being printed only once.
    Also refer to http://www.oracle.com/technetwork/developer-tools/adf/learnmore/87-lov-using-shared-am-444769.pdf for the idea

  • Combo LOV search on VO exposed on Shared Application Module

    Hello,
    My Jdev version 11.1.1.6. Technology stack is ADF BC and ADF faces.
    I have a generic lookup table that provides static list of values for many pages. Most lookup types have short list of values i.e. 15-20 and are implemented as selectOneChoice but some are 100+ and are implemented as Combo LOVs.
    This lookup VO has been exposed on Application level Shared Application Module and all LOVs are implemented on data model side.
    The problem is with Combo LOV search functionality. If I try to search on column, putting X%, it returns all values and I noticed that no query is sent to database which means it has all the data already cached on application server and returning all rows from there.
    If I change the LOV's Base VO [i.e. lookupVO] to regular [non-shared] then it perfectly searches as per entered criteria and returns correct rows.
    Do I need to set something on VO (or some where) to return filtered records from memory?
    My BC objects extends custom framework extn classes. Can something be done in custom framework etxn classes affecting only where it is required and not affecting other VOs [non-shared] functionality?
    Please help.
    Thanks,
    Jai

    Pratap,
    Thank you for the response.
    The reason I need to use new xxCO on the page is this.
    Seeded page CheckoutLinesPG.
    It has advanced table on it where every column has it's one external region.
    The new LOV region xxRN is put on a page also under this table new column.
    1. When a requester (seeded region on the seeded page) is changed then my xxLOV should reflect the change and be populated according to what is selected in the Requester LOV.
    2. When one-time address is added (another seeded region on the seeded page) my xxLOV should be disabled, when one time address taken out - enabled again.
    So xxCO should apply to the whole page.
    The VO behind advanced table PoRequisitionLinesVO is extended with 2 additional attributes and will substitute, the new xxVO is under xxAM data model.
    All works fine with my methods in the seeded RequisitionAM which I get a handle to in the xxCO. But I don;t know how to get the handle to the xxAM if I put my methods there.
    Thanks,
    Anatoliy
    P.S. just fyi - I know it is not the recommended approach but what I did for now I put all calls into the controller - in the controller I can get a handle to root AM, through that I am getting a handle to xxVO which (!) is substituted during runtime with my xxVO. But if you can figure out how to get a handle to xxAM in my case it will be great.
    Edited by: asmirnov on Mar 24, 2009 2:04 PM

  • Sharing Application Module view Instances

    hi,
    I read the sharing application module instances but I didn't understand the difference of Application level shared Application Module and session level shared Application Module.
    Give the simple answer to this one.
    Regards,
    Ragu.

    To summarize what the documentation says: Session-scoped shared app module would only be accessible to a single user (session), whereas application-scoped shared app module can be shared by all users.
    John

  • LOV doesn't apply view critera working with shared application module.

    Hi,
    I have a shared application module to share lovs between applications.
    These lovs have bind variables in the where clause and in view criterias.
    When i use these shared lovs, if i select in the view accessor, more than one view criteria to be applied in the view accessor, all rows are selected, it seems that any view criteria are applied or they are applied with an OR operator, althougt in the view accesor indicate that they will be add with an AND operator.
    thanks!

    I also have a similar problem. View criteria dos not applied in LOV from shared AM. Workaround - in base VO view row implementation for base love attr setter add re-query for LOV view accessor:
    ViewObject vo = getSharedAM_RefItem1_1().getViewObject();
    vo.applyViewCriteria(vo.getViewCriteriaManager().getViewCriteria("RefItemViewCriteria"));JDeveloper 11.1.1.6 (Build JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192.1)
    Edited by: VitalyCoder on 25.02.2013 10:53

  • Question about shared application modules

    Hello,
    I read the part in the developer guide but I still have some questions.
    1) The dev guide states that shared app modules use a different configuration.
    I assume this is the <appmod>Shared configuration?
    2) Where is this defined? Can this be changed?
    3) I understand there are two type of ‘scopes’ session and application. I’m using application for static lists, but I do not understand what the session scope is for? Is there any reason to use this scope over a normal application module?
    4) We have a system which uses VPD in an ‘odd’ way. We use it to set the current working year. Because the data is bound to years. Is it possible to use a session scoped shared module for this? And when I changed the current year (Context being set via the app module) to refresh all the session scoped shared module’s views?
    -Anton

    Anton,
    Yes, you can jump aroundd as you like.
    You just can't use view links between VO's based on different db schema tables.
    Nesting AM's doesn't help there, the DB connection of the top-level AM will be used.
    Why don't you create synomyms for the tables in the other schema?
    Steven Davelaar,
    JHeadstart Team.

  • Sharing application modules

    Hi,
    I have an application (ADF) running on Oracle AS. Lets call it Application A. This application comprises of about 10 projects (modules).
    I am creating a new webservice that uses some of the application modules, view objects and entity objects of Application A. I will be deploying this webservice as a separate application on the same Oracle AS.
    Is there someway for my webservice to use Application A's app modules, view objects and entity objects without physically including them in the webservice ear/war. This will help me keep my code in-sync.
    Thanks.

    Hi Frank,
    We (colleague of Nilesh) unfortunately can't wait for 11g esp. because you can't give a release date.
    The problem we are facing is that we see the same queries hitting the database over and over again. So caching these queries for a 'longer' period of time would save us a lot of round trips to the database.
    The data we want to cache is releasable stable, the data we select is separated from the data we insert. So we can store the data over a longer period of time.
    But as I understand it, there is no solution that would solve such a usecase? (Other then using a different framework/ building a custom solution)
    Message was edited by:
    Thijs Vonk

  • Application module configurations

    Hi
    When I right click on an application module and choose Configurations... there are two configurations for a given application model (for example AppModuleLocale and AppModuleShared) in the manage configurations dialog. I couldn't find anything about the usages and differences of these two configurations on the net. Would you please tell me about this?
    Cheers,
    Ferez

    These are the two configurations which are created by default by the framework. The 'local' configuration is for normal use as a web application with multiple users accessing the application. The 'shared' configuration is a special use case where the application module is shared by multiple other application modules, e.g. when the data accessible via the shared application module is quasi static in nature. This kind of application module is often used for look up data.
    If you check the 'Pooling and Scability' parameters of the two configurations, you'll notice the difference in the 'MaxPoolSize' parameter. For 'shared' application modules this parameter is set to 1, as there are no changes in the data expected and the same application module can be used for all queries.
    Timo

  • Defining Application module

    I need to get the exact points on how to define the Application Module.
    I feel AM as the definition for initializing or grouping set of EOs VOs etc.
    So what are the points in doing this grouping?
    In some cases common EOs and VOs are used for different functionality.
    Is such cases what is the best way of defining AM, define several AMs or do all functions in one AM?
    Is there a big performance issue too on this decision?
    Please explain.
    Thanks.

    Hi,
    I suggest you begin by reading chapters 9 and 10 from the Developer's Guide:
    "Implementing Business Services with Application Modules" http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcservices.htm
    "Sharing Application Module View Instances" http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bclookups.htm

  • Sharing data among Application Modules & Sessions

    Hi,
    I have small BC4J application, which has around 5-6 application modules. One of those application modules is the entry point i.e. the client will first invoke the start method in that application module. This entry point application module will further use other application modules.
    I am using the database tables heavily so I am thinking of caching the required data on the application server side.
    What is the best way of sharing this cache among all the AMs in one session and also among all the sessions?
    For sharing cache in single session, I think we can create the instance of cache in the entry point application module, and then pass it to the rest of the application modules. Please let me know if there is better way of doing this?
    Thanks.
    Nilesh

    Hi Frank,
    We (colleague of Nilesh) unfortunately can't wait for 11g esp. because you can't give a release date.
    The problem we are facing is that we see the same queries hitting the database over and over again. So caching these queries for a 'longer' period of time would save us a lot of round trips to the database.
    The data we want to cache is releasable stable, the data we select is separated from the data we insert. So we can store the data over a longer period of time.
    But as I understand it, there is no solution that would solve such a usecase? (Other then using a different framework/ building a custom solution)
    Message was edited by:
    Thijs Vonk

  • Sharing view objects across application modules

    Our application uses multiple application modules because of the complex functional requirements. We have come across sharing view objects among application modules. I want to understand the best practice, sharing view object instances across application modules. These view objects can be based on Entity Objects also.
    Please let me know if there any suggestions.
    Thanks,
    Satya

    Hi Satya,
    You won't be able to share view objects between application modules, but what you can do is to share the bind variables between application modules, if each of your module contains the 'common' view object.
    A solution for sharing data between application modules is provided on this blog: http://andrejusb.blogspot.co.uk/2012/05/solution-for-sharing-global-user-data.html
    You can use this approach to share bind variables between AM's and re-query the same data.
    Hope this helps,
    Florin Marcus
    www.redsamuraiconsulting.com

  • Sharing a BC4J application module amongst sessions

    Is there any method of sharing an application module amongst many sessions. Take BC4J/JSP on a single web server. We have a considerable amount of static lookup data that rarely changes and it seems daft to have to store this in the entity/view cache for every application module (one per active session).
    If we have a 100 sessions running I don't won't to store the lookup data 100 times. The smaller the session memory footprint the better.
    Anyone got any ideas?

    Hi,
    In 9.0.5 there is a property, "jbo.ampool.isuseexclusive", that may be used to configure this behaviour for an ApplicationPool.
    The summary is that when this property is false SessionCookie.useApplicationModule requests do not return an ApplicationModule that is reserved exclusively for that SessionCookie. Instead the AMs in the "intial pool" are shared by all SessionCookies that are using that pool.
    The reason that this is not formally documented is that it will not work with the declarative binding layer.
    Though BC4J itself is designed to be threadsafe you could still get race conditions on the default iterators. Imagine two threads that are looping through the rows of the default RSI of a deptVO in an unsynchronized block and, consequently, interleaving next calls.
    This is not an issue for programmatic clients as long as each thread of control instantiates their own RSI for access, simply does not use RowSetIterators, or implements synchronized, re-entrant use of an RSI.
    Please see the documentation for examples of developing a programmatic client that uses the pool APIs directly.
    Hope this helps,
    JR

  • Application module sharing

    I need to share the same application module between bc4j uix xml's
    and my event handlers in java. I think it's a common problem but
    documentation says nothing about this. How can I realize this.
    Thanks, Alex

    Define your applicationModules in a seperate project.
    Define your clients in their own projects. (all in the same workspace)
    Use the mechanisms in each client, to define a connection to the AppModule.
    In your client project, setup up a dependency to your BC4J project (or include the necessary libraries).
    If you use wizards to create your client code, it will set this up for you.
    Because you've got seperate projects, you can now deploy the middeltier and the clients independently.

  • Application Module instance not found in task flow

    Hi,
    i am working on Oracle Jdeveloper 11g Release 1
    I have created a bounded task flow for with following properties:
    <transaction id="__14">
          <new-transaction/>
        </transaction>
        <data-control-scope id="__15">
          <shared/>
        </data-control-scope>
        <task-flow-reentry id="__13">
          <reentry-not-allowed/>
        </task-flow-reentry>I have declared a page flow scope bean in the task flow as:
    <managed-bean id="__5">
          <managed-bean-name id="__6">trainBean</managed-bean-name>
          <managed-bean-class id="__8">oracle.sysman.core.gccompliance.view.library.rule.patchRule.PatchRuleTrainBean</managed-bean-class>
          <managed-bean-scope id="__7">pageFlow</managed-bean-scope>
        </managed-bean>but when i am trying to access the AM Impl instance from bean methos as below:
    public static final String DATA_CONTROLLER = "ComplianceLibraryAMDataControl";
        public ComplianceLibraryAMImpl getDataControl() {
            DCBindingContainer bc =
                (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            ApplicationModule am = bc.findDataControl(DATA_CONTROLLER).getApplicationModule();
            return (ComplianceLibraryAMImpl)am;
        }I am getting null pointer exception in ApplicationModule am = bc.findDataControl(DATA_CONTROLLER).getApplicationModule();
    I am using the same way to get bean in other task flows as well , so i think the code to get bean is working correctly.
    What am i missing in this?

    thanks Puthanampatti ,
    This is working and i am able to get AM instance from this , But i am not sure what is the difference between:
    public ComplianceLibraryAMImpl getComplianceLibraryAM() {
    ComplianceLibraryAMImpl am = (ComplianceLibraryAMImpl)ADFUtils.getApplicationModuleForDataControl("ComplianceLibraryAMDataControl");
    return am;
    Referred methods:
         * Get application module for an application module data control by name.
         * @param name application module data control name
         * @return ApplicationModule
        public static ApplicationModule getApplicationModuleForDataControl(String name)
            return (ApplicationModule) JSFUtils.resolveExpression("#{data." +  name +  ".dataProvider}");
         * Method for taking a reference to a JSF binding expression and returning
         * the matching object (or creating it).
         * @param expression EL expression
         * @return Managed object
        public static Object resolveExpression(String expression) {
            FacesContext facesContext = getFacesContext();
            Application app = facesContext.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = facesContext.getELContext();
            ValueExpression valueExp =
                elFactory.createValueExpression(elContext, expression,
                                                Object.class);
            return valueExp.getValue(elContext);
        }And my previous approach:
        public ComplianceLibraryAMImpl getDataControl() {
                     DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                     ApplicationModule am = bc.findDataControl(DATA_CONTROLLER).getApplicationModule();
                     return (ComplianceLibraryAMImpl)am;
        }Why am i not able to find my data control AM from Binding Container????

Maybe you are looking for