ADF BC 组件的运行时介绍 -1 Application Module的状态管理

原文连接 [ADF BC 组件的运行时介绍 -1 Application Module的状态管理|http://blog.csdn.net/genexujin/article/details/7086679]
ADF BC 框架中提供了开箱即用的应用‘状态管理’的功能。所谓状态管理,英文就是State Management,指的是维护用户在使用应用系统时的会话状态。概念上可能会和Http Session对象混淆。ADF BC提供状态管理是独立于Http Session机制的,自成体系的一个机制。
状态管理基本概念
首先来说,为什么需要状态管理?在一个应用被用户使用过程中,每个用户会有很多不需要立即存放到数据库中的信息,比如说一个购物车中的商品,一笔未完成录入的订单,一个查询输入的参数等等,这些信息只有在最后确定后才会提交到数据库事务处理。
然而,做过web应用开发的童鞋应该都很清楚,我们天天玩的这个HTTP 协议是一个无状态的协议,它不会和服务器保持一个连接,因此也无法在协议层来提供对连接状态的维持机制。 因此,开发人员为了维持用户使用系统过程中的状态,就需要通过其他方式来实现。最常见的就是利用浏览器的cookie,其机制如下:
在一个新的http 请求发送到服务器时,服务器会查看http包中的头部信息是否包含cookie信息,如果没有则认为该用户request是一个全新的会话开始。服务器会在返回结果response中写入该服务器所在domain的一个cookie。Cookie里面会有一个字符串来唯一的标示一个用户的会话(浏览器窗口)。Server端会根据这个字符串token,来将系统状态信息唯一对应到一个HttpSession对象中(JEE Container)。HttpSession对象中存放的数据是一个个key/value对,应用可以将在一个会话期间保留的状态信息都会存放在该对象中。这是JEE标准的容器都会应用的一种模式。这种模式在需要高可用性的情况下,就需要在服务器之间传递Session对象,以保证Session不会因为一台服务器故障而丢失。在网络上传递Session对象需要将Session序列化,并且要求Session包含的对象也都是可序列化的。同时,频繁的Session对象更新会增加很大的网络流量,降低系统的整体性能。当然,最近版本的Weblogic服务器已经提供了对Coherence的支持,可以通过Coherence数据网格来维护Session在一个集群中的高可用性。
ADF的状态管理和HttpSession有何不同
通常,我们在HttpSession中存放的是业务数据。在一个充分设计分层的架构下,通常存放的是一些POJO对象。这些POJO不会记录底层数据访问层的状态(比如:一个查询的条件,查询结果的当前的游标位置,查询返回的结果集等等)。这些技术类的状态,在一般的架构下,是不会作为系统的状态来进行管理的并存放在HttpSession中的。ADF BC实现了一套独特的数据访问层的状态管理,可以使一个用户Session的多次请求都使用相同的Application Module的实例及其保持的状态来进行数据访问。从而,提高了数据访问的性能。当然,提高性能是相对其本身没有这套机制而言的,并非和其他持久化框架做比较。可以讲,如果ADF BC没有这样的机制会大大降低其运行的效率。
ADF BC状态管理原理。
原理上ADF BC对AM的管理如下图所示:
AM池 默认情况下,ADF的运行时会维护一个或者一些AM的实例池,每一个根节点的AM都会有一个独立的池。如果有新的用户访问,ADF框架运行时会从AM池中返回一个实例给当前线程中的Data Control。Data Control的实例会被一个ADF Binding Context实例所引用,该ADFBinding Context则会保存在HttpSession中。保存在HttpSession中的这些对象,都是轻量级的对象,占用很少的内存不会造成大的性能的影响。 同时,AM的实例池会维护每个session cookie token和AM实例之间的关系。
重复使用AM实例 当下次有相同用户的request来的时候,会从AM池中返回上次其使用的AM实例以及相关的状态(Entity对象,View对象的缓冲,View对象的查询条件,绑定的参数等信息)。如此,避免了重新建立AM状态的开销。
Passiviation/Acitvation在一个高并发的场景下,AM池可能不得不将以及标签为有用户使用的AM实例提供给新的用户request,每个AM实例可能无法每次都能够等到上次服务的用户request(一般来说我们不会将AM的池设置为和最高并发数一样多,可能是最高并发数的20%)。在这样情况下,AM就会将其状态passivate到一个数据表中。这些状态信息会以一个XML的形式存放。 通常在ADF的应用schema下会发现这样的一个表:PS_TXN。可以设定一些数据JOB来定期清理其中的数据。当原来的用户再次访问时,AM池就会将原来AM实例的passivation的数据从数据库中读回并装载到一个AM实例,这个过程称为Activation。通过这种方式,实现了AM的状态恢复。
在集群环境下 我们会将jbo.dofailover参数设为true。这样为了保证AM状态的高可用性,在每次request结束时都会将AM状态做passivation。
稍微总结下:
AM实例可能的状态:
buzy: 被一个user request使用中。
referenced: AM的状态被维护中,等待下次相同的用户request。也可以被任何其他request使用,如果必须的话。
unreferenced: AM在pool中,可以被任何request使用。
AM状态管理的持久化方式:
Passivation = EO/VO的Snapshot被存放到数据库中。
Recycle = reset:实例的状态被消除,并准备服务一个新的client
Activation=将EO/VO的数据从数据库读回到AM。
在HA模式下passivation在每次request结束时进行,但recycle/activation并不会在每次request开始就进行。只有当服务器负载要求一个实例为新的客户端服务时才进行。换句话说,每次做passivation 并不会马上对AM坐recycle。Recycle只有在需要的时候才会进行。在非HA模式下,passivation会在负载需要的时候进行,并且紧接着会进行recycle和acivation。
默认情况下,每个AM都会hold住J 一个数据库的连接,直到这个AM被destroy。因此在进行数据库连接池的配置时要确保每个AM会有足够的连接可用,因为默认情况下AM拿到连接后不会在每次request结束时释放的。ADF BC也提供了参数来改变这一默认行为,具体配置方式请参考开发手册,以后有空的时候也会继续总结。

好文章,可以考虑在OTN上正式发表。

Similar Messages

  • ADF BC: Optimal Application Module Runtime Configuration

    Have implemented an intranet application for 1000 users using the following technologies implemented on Oracle JDeveloper 10.1.3.0.4:
    ADF BC for my Services layer
    JSF for my Controller layer
    JSF and ADF for my View layer
    ADF Model for my Data layer
    The application is entirely designed by .jspx and .jsp pages (for reports), handling 106 application modules, with several entity and view objects and without any step-by-step stateful scenario. At each page, there appears a commit button to commit the end-user transaction, and a rollback button to return to the previous page.
    The application is database-backed from an Oracle Database 10g, deployed on three application servers Oracle 10.1.3.1 on three different hosts on Suse Linux OS, used data-source connection and AM pooling, and load-balanced by one webcacher in front of the 3 servers.
    Under stress test scenario, on a heavy system load in production environment, several ADF State Management errors were recognized that pushed the webacher and application server with the maximum load to automatic restarts due to either demand for JVM increased heap size or errors from the database that the TNS listener complained it could not handle any more connections.
    Thus, we started a safety/reliability tess for all our application module components (disabling "Enable application module pooling"), and a stress test using a third-party stress tool at work, but we're still faced with several questions.
    (a) What is the best strategy for AM configuration, to quit State Management at all since our application doesn't need it, and if so can it be done globally or declaratively and not individually and programmatically?
    (b) Testing on application module runtime configuration, we observed that not to "hang-on" on a connection -default functionality- but to release it at the end of each HTTP request, as each deployment is concentrated on a single data-source connection pool/single user, brought less open JDBC connections on A.S.? Is this the optimal run-time configuration than the default for our case?
    (c) If State Management errors are resolved, and using a software balancer before 3 application servers, regulate the traffice by 1/3 to each, is it possible that a system crash will be avoided next time?
    So, our problems related to ADF tunning and State Management Errors, but we need a good advice on this topic as the overall documentation is case-specific.

    Chapter 29 "Understanding Application Module Pooling" in the ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html is the best place to start. There is no "magic" optimal configuration that I (or anyone here, really) can suggest to you. You need to understand the various "knobs and dials" that control the pool sizing and pool cleanup behavior, and then apply application-specific information to this information to derive what the optimal configuration for your particular application will be. The chapter explains how the application module pool and database connection pool interact, and in which situations it is best to change the default setting of the jbo.doconnectionpooling property to true.
    Chapter 28 "Application Module State Management" describes the functionality of that facility of the framework, as well as how to release the application module in stateless, unmanaged mode if you need to.
    By following the tips in the section "28.3.2.4 Setting Release Level in an Custom ADF PageLifecycle" (which builds on information introduced in section "10.5.4.1 Globally Customizing the ADF Page Lifecycle"), you can generically impose a different release level in your application without "touching" every page.
    As a general rule, if you have:
    (*) Lots of distinct application modules
    (*) Each of which is used as a separate data control (rather than being nested inside a containing application module as described in section "8.9.3 Root Application Modules Versus Nested Application Module Usages" of the dev guide)
    (*) Each of which uses the same database connection
    Then as described in section "29.8 How Database and Application Module Pools Cooperate" in the guide, your application can decrease the total overall number of connections used by using the non-default setting of jbo.doconnectionpooling=true.
    Applications using many distinct data controls in the span of a single user's session need to be aware of Bug# 4566186 ("PERF: ADFBINDINGFILTER CHECKS OUT ALL ADF BC DATA CONTROLS USED AT LEAST ONCE"). This issue has been fixed in JDev/ADF 11g, but apparently the fix was too complex to accommodate a 10.1.X backport. I'm trying to document a workaround and publish it on my blog, but I'm not finished with it yet.

  • ADF Libary Issue - Application Module disappear from data control

    Hi All,
    I am facing an issue while adding an Application module to an ADF project as an ADF libray.
    I have two applications - ADF Application1 with Model1 project having an Application module AM1, ADF Application2 with Model2 project having an Application Module AM2
    I have created an ADF library jar file of Model1 project.
    When I add it to Model2 project, the Application Module AM2 of Model2 disappears and Application Module AM1 from the library appears in data control.
    Please suggest what could be wrong.
    Regards,
    Rekha

    Hi,
    verify that both application modules don't share the same ID in their databindings.cpx file. Which release version of JDeveloper 11g are you on ?
    Frank

  • ADF call different application module using groovy

    Hi All,
    I have a requirement where I need to call method in application module. As we all know we can call it using adf.object.applicationModule.someMethod();
    But I have a requirement where I have two Application modules. I have method defined in second application module. So how to call this method defined in second application module.
    Please help me how to solve this issue. I am using JDev 11.1.1.5
    Thanks,
    Rajesh.

    Maybe this can help:
    https://blogs.oracle.com/jdevotnharvest/entry/remote_task_flow_vs_wsrp
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/43-remote-task-flow-169185.pdf
    Dario

  • ADF customization: AM(Application Module) not picking up customize changes.

    Hi All,
    We have customize curtain ADF BC4JC objects, from the seeded application, but the issue is the Extended AM which is consuming the customize is running after some tweaking in the adf-config.xml file.
    But problem is its not picking up any customize changes, can someone tell how to debug the customization related issues in bc4j itself.
    or tell us is it not possible to see the customize changes in model layer of ADFBC.
    Thanks
    VIpin

    Hi All,
    We also noticed onething in sandbox, when we are deploying the changes to sandbox, extactly two stantus are coming there
    |-> merged (o) sign is reflecting it
    |-> add on layer sing is reflecting it .
    we noticed that merged layer changes we are able to see in the application but added layer changes are not coming, and we are not exactly sure when a layer is merged.
    Added we are fine.
    Thanks
    Vipin

  • ADF & Spring: Application Module

    Hi!
    Im testing a mix of ADF and Spring.
    I create an Bean in the Spring Context that is an ApplicationModule
    <bean id="myAM" class="oracle.jbo.client.Configuration" factory-method="createRootApplicationModule">
    <constructor-arg><value>mypkg.myAM</value></constructor-arg>
    <constructor-arg><value>MyAMLocal</value></constructor-arg>
    </bean>
    Testing the application it works fine.
    But I want more and i wish the ADF takes this instance of MyApp and avoid a new instantiation of it. (Now i have 2 instances of MyApp, one created by Spring and another created by ADF)
    Theres some way to say ADF to take an existing instance to put it in the session or somethig?
    Thank you!!

    OK the question is Why??
    Seriously though - you can create a data control that exposes Spring artifacts through the Data Control palette which would seem to be the more normal way around. Do you need the Application Module to inject it into some other Spring Artifact?

  • ADF panel executes all queries in the application module.

    Hi all,
    I have created an ADF Panel, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
    As I add more functionality meaning more available queries meaning more ADF views and ADF view links, running the Application Modules becomes slower.
    Let’s say the application module AM1 is made of 30 different view links. And application module AM2 is made of another 30 view links.
    Now let’s say that ADF Panel1 references 8 view links from AM1, but it appears that all 30 view links that make up Application Module AM1 are executed before returning the result sets of the 8 view links referenced in ADF Panel1. Let me also underline the fact that each view link in Application Module AM1 can be executed independently, so the question is how I can make Jdev not to run all 30 queries in view links in the Application Module AM1 when ADF Panel1 is executed, but just the 8 that are referenced in the ADF panel1.
    I hope I made my question understood.
    Your inputs are greatly appreciated.
    Thanks.
    Bobby A.

    Hi,
    if this is what you see then you should file a bug because certainly its not the way it is designed to work. Note that in JDeveloper 11g - you don't specify the release you are on - the iterators by default are set to refresh deferred. Only iterators that belong to a PageDef file are executed when the page loads (you can suppress this by setting a refresh condition). Other queries are not executed
    Frank

  • Coding custom business methods in ADF BC Application Module ?

    Dear All,
    Where do i put my custom business methods in ADF BC Application Module ?
    Can anyone point me to a good tutorial which gives a good insight into developing ADF BC Applications ?
    Thanks,
    Raghavendra

    Hi,
    there will be a developer guide out soon. Its written by Steve Muench and provides an indepth walk-through ADF BC.
    To answer your question, custom code is written in Java files on the ApplicationModule, ViewObject and EntityObject level. If you go to the Editor of each of these components there is an option for you to create Impl.java and RowImpl.java files. The first is for generic business logic, the latter for row based logic
    Frank

  • Using Application Module outside ADF Application context

    I am trying to run application module using a standalone java class. Trying to use Application Module outside ADF Application context.
    I have created a jar file on my standalone java class, and added my ADF application jar files to the classpath while running my standalone java file as a Jar file.
    I could connect to the application module and I am able to get the response from my application module.
    Below is the code I used to invoke my application module method from my standalone java class.
         public static void main(String[] args) {
              System.out.println("Testing .....");
             String jdbcURL = "jdbc:oracle:thin:@localhost:1521:XE";
             Hashtable env = new Hashtable();
             env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
             env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
             try {
                 Context ic = new InitialContext(env);
                 String defName = "com.org.model.BatchJobAppModule";
                 ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(defName);
                 ApplicationModule mbApplicationModule= (ApplicationModule)home.create();
                 mbApplicationModule.getTransaction().connect(jdbcURL, "HR", "HR");
                    ((BatchJobAppModuleImpl)mbApplicationModule).connectToDatabase();
             } catch (NamingException ne) {
                 // TODO: Add catch code
                 ne.printStackTrace();
    {code}
    I am getting following messages.
    {code: warning}
    oracle.adf.share.ADFContext getCurrent
    WARNING: Automatically initializing a DefaultContext for getCurrent.
    Caller should ensure that a DefaultContext is proper for this use.
    Memory leaks and/or unexpected behaviour may occur if the automatic initialization is performed improperly.
    This message may be avoided by performing initADFContext before using getCurrent().
    To see the stack trace for thread that is initializing this, set the logging level of oracle.adf.share.ADFContext to FINEST
    Dec 14, 2012 10:16:37 PM oracle.security.jps.internal.config.xml.XmlConfigurationFactory initDefaultConfiguration
    SEVERE: java.io.FileNotFoundException: D:\satya\testPackage\.\config\jps-config.xml (The system cannot find the path specified)
    {code}
    I have another question regarding connecting to database.
    How to get connection from a datasource, to avoid supplying database credentials which will vary from one environment to another.
    Please let me know if any one has pointers.
    Thanks in advance.
    Regards,
    Satya
    Edited by: 921138 on Dec 14, 2012 9:20 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Thanks Shay for your response.
    When I run the standalone java class from jDeveloper 11.1.1.5.0, I am able to get application module and also able to get the out put from application module method. While running the java class jdev is exectung the class with javaw command. I tried to execute the same from commnd prompt, it didn't print anything on the command prompt. So I tried to execute java command with "java followed by class path" as below.
    set JAVA_HOME=C:\Oracle\Middleware\jdk160_24\jre
    set PATH=%JAVA_HOME%\bin;%PATH%
    java -classpath E:\poc\TestBatchJobClient\Project1\deploy\First.jar;E:\poc\BatchJobApp\Model\deploy\adf-share-base.jar;E:\poc\BatchJobApp\Model\deploy\adfm.jar;E:\poc\BatchJobApp\Model\deploy\BatchJobApp_Model.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adf-share-support.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-ca.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-base.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adflogginghandler.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adfsharembean.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jmx_11.1.1\jmxframework.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jmx_11.1.1\jmxspi.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.idm_11.1.1\identitystore.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\adfm.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\bc4j-mbeans.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\bc4jwizard.jar;C:\Oracle\Middleware\oracle_common\modules\groovy-all-1.6.3.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\db-ca.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\jdev-cm.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.ldap_11.1.1\ojmisc.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\commons-el.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\jsp-el-api.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\oracle-el.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.javatools_11.1.1\resourcebundle.jar;C:\Oracle\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.mail_1.1.0.0_1-4-1.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\oramds.jar;C:\Oracle\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle\Middleware\modules\javax.jsp_1.2.0.0_2-1.jar;C:\Oracle\Middleware\jdeveloper\ide\macros\..\..\..\wlserver_10.3\server\lib\ojdbc6.jar;C:\Oracle\Middleware\oracle_common\jlib\commons-cli-1.0.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.bali.share_11.1.1\share.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xmlef_11.1.1\xmlef.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.dms_11.1.1\dms.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.javacache_11.1.1\cache.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.ucp_11.1.0.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.javatools_11.1.1\javatools-nodeps.jar;C:\Oracle\Middleware\modules\javax.management_1.2.1.jar;C:\Oracle\Middleware\modules\javax.management.j2ee_1.0.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.ldap_11.1.1\ldapjclnt11.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-api.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-common.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-ee.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-internal.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-unsupported-api.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-manifest.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jacc-spi.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.pki_11.1.1\oraclepki.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_core.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_cert.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_ws_sx.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.iau_11.1.1\fmw_audit.jar;C:\Oracle\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.security_11.1.1\adf-share-security.jar -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks com.org.TestMyClass
    {code}
    I got the same old error.
    Regards,
    Satya                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ADF Groovy call method in different application module

    Hi All,
    I have two different application modules(Say TestAM.xml and MyTestAM.xml). I have a method in second application module. I want to call that method from Entity object. Normally we use adf.object.applicationModule.getName()  if it is in the first application module
    So how do I call a method in second application module from Entity object?
    I am using JDev 11.1.1.5 and ADF BC.
    Thanks,
    Rajesh

    Hi,
    In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
    regards

  • InternalDCAM - How to tune InternalDCAM application module (ADF - 11.1.1.6)

    Hi All,
    We are load testing our application (Oracle ADF 11.1.1.6) using 100 concurrent users. All of our application modules are tuned with initpoolsize of 100, minavailablesize of 100 and recyclethreshold of 100. These arguments intended to not passivate any of our AM for 100 concurrent users. We noticed in enterprise manager that system is creating InternalDCAM application module automatically and it seems it is growing/passivating more frequently than any other AM.
    I understood from Oracle support search that we need to pass JVM argument to control the behavior of InternalDCAM. I passed following JVM arguments but still InternalDCAM is showing same (default) behavior. Unlike other AM of our application, it still shows available pool size for InternalDCAM = number of sessions and not 100.
    -Djbo.ampool.doampooling=true -Djbo.ampool.initpoolsize=100 -Djbo.ampool.maxavailablesize=4096 -Djbo.ampool.maxinactiveage=3600000 -Djbo.ampool.maxpoolsize=4096 -Djbo.ampool.minavailablesize=100 -Djbo.ampool.recyclethreshold=100
    Can anyone point me to tune InternalDCAM?
    - Chetan

    Timo,
    Before creating this thread I had reviewed that thread and also noticed Steve's comment below -
    Steve Muench >> "At present, the pooling parameters for the application pool named InternalDCAMs created for these instances of ApplicationModuleImpl are the default values for the pooling parameters and are only controllable using parameters set as Java system properties."
    Setting this one in not working for me at least not in 11.1.1.6 version. Please let me know if it works for you. I passed VM arguments as given below
    -Djbo.ampool.doampooling="true" -Djbo.ampool.initpoolsize="100" -Djbo.ampool.maxavailablesize="4096" -Djbo.ampool.maxinactiveage="3600000" -Djbo.ampool.maxpoolsize="4096" -Djbo.ampool.minavailablesize="100" -Djbo.ampool.doconnectionpooling="false" -Djbo.ampool.recyclethreshold="100"
    - Chetan

  • Defining bc4j.xcfg for Webservice from ADF Application Module

    Hi all,
    I've already posted my previous question in JBO30003 while executing ADF Application Module WebService
    but no replies at all :)
    after thorough inspection, i found that why my client can connect to ADF AM and why my WebService Invocation is failed with JBO 300003. My J2EE Client application is connected to ADF AppModule with some configuration in CPX file.
    <JboProject
       id="DataBindings"
       xmlns="http://xmlns.oracle.com/adfm/application"
       version="10.1.2.18.73"
       SeparateXMLFiles="false"
       Package=""
       ClientType="JClient" >
       <Contents >
          <DataControl
             id="AppModuleDataControl"
             SubType="DCBC4J"
             SupportsFindMode="true"
             SupportsTransactions="true"
             Package="package"
             FactoryClass="FactoryImpl"
             Configuration="AppModuleEmbeddedAS" >
             <Parameters >
                <Parameter
                   name="Sync"
                   value="Immediate" >
                </Parameter>
             </Parameters>
          </DataControl>
    and so forththis CPX file define that this client connect to Application Module on my AppServer with "AppModuleEmbeddedAS" configuration, as stated in my BC4J.XCFG.
    <AppModuleConfig name="AppModuleEmbeddedAS">
             <AppModuleJndiName>AppModuleBean</AppModuleJndiName>
             <java.naming.security.credentials>welcome</java.naming.security.credentials>
             <DeployPlatform>EjbIas</DeployPlatform>
             <java.naming.security.principal>admin</java.naming.security.principal>
             <jbo.internal.embedded>true</jbo.internal.embedded>
             <HostName>localhost</HostName>
             <jbo.ampool.dynamicjdbccredentials>false</jbo.ampool.dynamicjdbccredentials>
             <ApplicationName>AppModule</ApplicationName>
             <jbo.ampool.doampooling>false</jbo.ampool.doampooling>
             <java.naming.security.authentication>simple</java.naming.security.authentication>
             <java.naming.factory.initial>oracle.jbo.common.JboInitialContextFactory</java.naming.factory.initial>
             <ConnectionPort>23891</ConnectionPort>
             <JDBCDataSource>jdbc/DBGEBPOC_on_LOCALHOSTDS</JDBCDataSource>
             <java.naming.provider.url>ormi://localhost:23791/current-workspace-app</java.naming.provider.url>
             <jbo.server.internal_connection>jdbc/DBGEBPOC_on_LOCALHOSTCoreDS</jbo.server.internal_connection>
             <jbo.dofailover>false</jbo.dofailover>
             <ApplicationPath>current-workspace-app</ApplicationPath>
             <jbo.ampool.resetnontransactionalstate>false</jbo.ampool.resetnontransactionalstate>
          </AppModuleConfig>Now, how could I define configuration like my J2EE Client in my web service? as we know that web service's client is web browser. Does it mean that we can't define any CPX file?
    FYI, My webservice's End Point pages is successly shown up. but when i invoke the method, it returns XML with faultmessage Error JBO30003.

    Hi,
    You can directly edit the bc4j.xcfg file. Note that the WebService binding is not created from the Am directly but from the deployed WSDL file.
    Frank

  • JBO30003 while executing ADF Application Module WebService

    Hi all,
    I'm using JDev 10.1.2.0 build (1913), Application Server 10g (9.0.4.0.0), Database 10g (10.2.0.1), All of them runs on Windows XP box. Currently, I'm developing a Web Service application from my existing J2EE application. The existing J2EE application uses ADF (client and server side), SpringFramework RCP (client for menu framework)+Swing. It was compiled and run succesfully. Client can connect to application server, accessing EJB, database.
    The problem occurs when I try to make another deployment that support WebService. We know that with JDev, we can easily create WS App from EJB. Since my EJBs are statefull--which cant be use for WS--I try to make WS from Application Module, by simply drag J2EE WebService in Remote App Module Dialog Box. The WSDL is created, Interface is created too.
    For deployment to AS, i'm using ant because JDev can't create EAR file with proper library. I've done this:
    1. copying snippet code web.xml from JDev generation to my web.xml, starting from Servlet tag until servlet mapping.
    2. include wsdl file for my JAR file
    3. deploy to AS with Enterprise Manager
    The WS End Points can be access from http browser. All of methods are accessible. But when I'm invoking any random method, the result is always like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server.Exception:</faultcode>
    <faultstring>oracle.jbo.common.ampool.ApplicationPoolException: JBO-30003: The
    application pool (xxx.xxx.xxxxxx.model.service.SOSAAppModuleLocal) failed to
    checkout an application module due to the following exception:</faultstring>
    <faultactor>/serverpoc/AppModuleService</faultactor>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>is there some XMLs snipped code from JDev's WS generated file that i'm not put them in my ant's XMLs? because i'm sure that all of my EJBs in same EAR file with WS application are accessible from ADF Swing Client
    i'm googling the error message JBO-30003, but none of them fits my problem. Any help and suggestions are appreciated. Thanks...
    :)

    i notice that there is file Webservice.deploy. What is it for? I assume that file is used by some kind of proccess of JDev to deploy EAR file.If it is a compulsory file, how to convert it to ANT build file?
    I've modified some classes in my working J2EE application, and deploy it with JDev to my AppServer. But still, while invoking anymethods of WebService at my endpoint, it also has same XML response that an error occured with JBO-30003..
    Having searched in oracle, i found examples are using JDev 10.1.3 which is completely different with my JDev 10.1.2 (build 1913). I cant follow that tutorial. Any one know how to deal with this issues?
    Thanks

  • Use of application module pool and ADF Busines Components

    Hi to all;
    Lets suppose an web application with about 10 CRUD forms and 15 to 20 reports or forms just to query and show data;
    That's clear to me, all the advantages of using App modules pool.
    But for that reports ..... Just an Read only and Forward Only data ?
    I was wondering, if it will be more effective and lightweight if we just take an JNDI JDBC connection query data and show it.
    This imaginary application will make use of application module pool to provide that 10 CRUD web forms and in other hand, will have for reports,JNDI data sources;
    What are your opinion about having this two architectural approach working together in one application ?
    Very thanks;
    Marcos Ortega
    Brazil;

    Hi Deepak;
    BC4J in my opinion is great and i am proud to share this opinion with all of you;
    As a meter of fact, i post this thread to help me better understand BC4J architecture.
    I think that my doubt main point is ...
    Are application modules pool's life cycle an extra work , when the job is just to read and show data ?
    Perhaps, an document about statefull and/or stateless application service release, help me;
    IMHO;
    cached data most of the time must to be discarted for reports, always we want to query database directly, View's object ClearCache() method would be called to reports.
    I think that it's different, when we are talking about sequent requests when we need to span the session, views and entities states.
    Forwards Thanks;

  • How to use prepared statement by Application Module on ADF?

    Hello
    i am using a prepared statement on the view side of my project,
    this is my code, i'm not sure about using this code.
    AppModuleGFTImpl am = (AppModuleGFTImpl) Configuration.createRootApplicationModule(amDef,config);
    try {
    ps =am.getDBTransaction().createPreparedStatement("Select * from XXXXXX where kullanici_id=? and sifre=?",0);
    ps.setString(1, kullanici);
    ps.setString(2, sifre);
    rs = ps.executeQuery();
    if (rs.next()) {
    girebilir = true;
    } else {
    girebilir = false;
    ps.close();
    rs.close();
    //am.getDBTransaction().closeTransaction(); ? I'm not Sure
    //Configuration.releaseRootApplicationModule(am, true); ? I'm not Sure
    Is it True? How we use this code on the project view side? Must we close Transaction, or release application Module.
    thanks for interest.
    sorry my english.

    Hello, for the SP you can use something like this in your application module
      private static final String BULKSTAMMENN =
        "begin IVA_OWNER.IVA_UI_ALGEMEEN_PCK.USM_SNELLE_INVOER_GUI( P_RLE_ID => :1, P_AANTAL => :2, P_OJR_JAAR => :3, P_RAS_ID => :4, P_TOELICHTING => :5, P_SUCCES => :6 ); end;";
    public void bulkStamen ( int rasId, int telerId, int jaar, int aantal, String toelichting ) {
        CallableStatement bulkStamenSP = null;
        try {
          bulkStamenSP = getDBTransaction().createCallableStatement( BULKSTAMMENN, 0 );
          bulkStamenSP.setInt( 1, telerId );
          bulkStamenSP.setInt( 2, aantal );
          bulkStamenSP.setInt( 3, jaar );
          bulkStamenSP.setInt( 4, rasId );
          bulkStamenSP.setString( 5, toelichting );
          bulkStamenSP.registerOutParameter( 6, Types.VARCHAR );
          bulkStamenSP.executeUpdate();
        } catch ( Exception e ) {
          log.warning( "Aanroep naar " + BULKSTAMMENN + " gefaald, " + e.getMessage() );
        } finally {
          if ( bulkStamenSP != null ) {
            try {
              bulkStamenSP.close();
            } catch ( Exception e ) {
              log.warning( e.getMessage() );
        log.info( "Stammen bulk uitgevoerd voor " + rasId + " " + telerId + " " + jaar + " " + aantal + " " +
                  toelichting );
      }You can then drag this method onto your page or right into your task flow if your using JDev 11.
    Also you can access it from a backing bean although the methods above are preferred
    -Anton

Maybe you are looking for