ADF Application Module cache

All,
I'm getting some value form the View Object and displaying it on screen, in case of failure result, I have a go back link, which helps the me to query again.
In second try when I enter the right value, it some how fetches the result for the previous input (first try value). Looks like it is fetching the values form the cache. I tried to
run a viewobject.cache() and binding.refresh() but still I have the same problem. Can some one hlep me?
Thanks,
Jai.
Edited by: sjai on Sep 3, 2009 10:40 AM

I have a login page which authenticate the user, in case of authentication failure, I have a go back link, I
click this and go back to the originating page, now, when I pass the correct credentials, it fails to take the correct value, it finds my
previous entry and tries to use that.
-Jai.

Similar Messages

  • 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

  • How-To Access ADF application module with ADF faces

    Sorry for the repost but I don't get answer in the other Thread.
    If you look in this little demo you see that you get the DCBindingContainer bc = getBindingContainer(); initialization, but my method getBindingContainer(); gives back null.
    What could be the problem with this? Should I make some changes in preferences or something like that?
    I work with JDeveloper 1013
    Greetings Thijs

    Steve Muench made an example of that on his blog, here is the url for the source download: http://otn.oracle.com/products/jdev/tips/muench/accessbindingsinbackingbean/AccessAppModuleInBackingBean.zip
    There's one canveat to this technique however. #{binding} seems to be stored in requestScope and therefore can only be injected in request or none scoped managed beans.
    Regards,
    Simon Lessard

  • 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

  • When the application module starts the trans?

    Hi,
    For ADF application module, when does it start a trans?Is it the case the AM method(even read only method) exposed to view layer, then the trans starts automatically when the page is loaded? Or when getDBTransaction() is called? or even latter when actual update or some specific method is called from the trans? Just wondering whether a commit/rollback is expected when even an exposed method is called by view layer even it is readonly.
    Hui

    Thx, Tim.
    We are use optimistic in the AMs. We have some AMs just do data query. But there is VPD on one of the table, query on the table will trigger the VPD table updates from database, and if db side detects the parent query sql has transaction associated, the vpd related update will not be committed and expects the parent trans will be commit/rollback But if the AM is cached, and no explicit commit/rolback was issued. Will the underlying VPD updates stay there not commit/rollback
    Hui

  • 3rd party payment integration with ADF application

    Hi ADF experts,
    We have a requirement to integrate our ADF application with 3rd party payment gateway.
    For this we have created 2 servlets(one to post data, and one for relay response) which will talk to payment gateway.
    Since we are using servelts, we wont have access to bindings or any of ADF features. We manage the handshake between servlets and ADF app by passing data through session variables.
    I am not happy with this solution, even though it works in our test environment. I would prefer a complete ADF soultion rather than using servelts/jsps.
    Is there a standard way(either inbuilt in ADF or extensions) to integrate 3rd party gateway with ADF application which is safe and secure?
    Jdev used: 11.1.1.1.5
    Payment gateway used: authorize.net
    thanks
    -Venkat

    You can access adf application module from a servlet. All you have to do its to setup a pagedef for the servlet.Check out my blog http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/ Which shows how to do this.
    I'm not aware of standard integration to a payment service.
    Timo

  • ADF Appication Module uses RMI or not?

    Anyone know what kind of transport the ADF Application Module uses for remote calls? I know session beans use RMI for call on the remote interfaces (which therefore mandates throwing a RemoteException in every method being exposed to the clients). However I do not see any such mandate to use remote exception for ADF business services. Which leads me to ask the question if ADF uses RMI or not for remote communication?

    Hi,
    the databinding meta data is not synchronized with ADF BC or any other business service. If e.g you used EJB session beans and changed the method signature of a method used in teh View through ADF, then this is not automatically refactored.
    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 application integrating with Oracle Web Cache

    Hello,
    I am trying to integrated my ADF 11g application with Oracle Web Cache. I used this link http://andrejusb.blogspot.com/2010/06/oracle-webtier-11g-configuration-for.html for it.
    I am able to access my ADF application using webcache port 7785.
    I created few caching rules in the Oracle Web Cache. And in the popular request section of the Oracle Web cache i see jpg,png and other image files cached.
    But the issue is when the application access images like /testapp/test/images/abc.jpg?_adf.ctrl-state=5b0s7lzfo_29 . I created a caching rule with regular expression ^/testapp/test/images/[A-Za-z0-9_]*\.(gif|jpeg|png|jpg)\?_adf\.ctrl-state=[A-Za-z0-9_]*$.
    But when i access the popular request in em i don't see the URL given above as cached. The caching reason it specifies as URL contains query string.
    I am not sure if i need to do anything additional to cache these URL's as well.
    Thanks!
    Ram

    Yes that works. But my question is how to cache the urls which has querystring. I was trying to give a regular expression to match the url so that the url which contains parameters like _afrLoop which changes with each HTTP request can also be cached.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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上正式发表。

  • 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?

  • 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;

  • 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.

  • 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

Maybe you are looking for

  • How do I connect into my mac using Apple Remote Desktop

    I have version 2 of this but am not that network-savvy. How can I connect to my G5 at work, from home, and vice versa?

  • Boot Camp on iMac 11,3 with no ODD working

    Hello guys, I have been up and down for a month now with this problem....mostly down I have iMac 27" i3 (mid 2010) with broken ODD and I want to install Windows 7 64 via Boot Camp Assistant. I have done all this: Maverick Boot Camp - Partition and US

  • I need a flash player that does split screen with two "like" videos

    I am a newbie on Flash and really need some guidance or a source code to work off of.  I need a flash player that I can have two videos, overlayed with a mask at 50% on each so I see half of one video on the right and half of the other video on the l

  • Call RFC for Lookup from BPM. how to determin the correct target system

    Hi I have a scenario where i am sending a sync call to SAP R/3 to fetch some sata using the BPM. The issue is I can have multiple SAP systems so to determin the SAP system for the correct lookup is necessary. in the rec determination step of Config I

  • Getting List of Items in current container

    Hi all, I'm having another templating problem. I want to get all the items in my region, in order. I had been trying to use JHS.current.itemRegion.items, but that resloves to getItems(), which returns a Map keyed by item name. Order is important (and