Sharing a BC4J application module amongst sessions

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

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

Similar Messages

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
    by Steve Muench
    Overview
    BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
    For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
    public void createDepartment(int id, String name, String loc) throws AppException
    AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
    Creating the Stateless Session Bean
    We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
    We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
    package com.example;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface StatelessSampleEJB extends EJBObject {
      void createDepartment(int id, String name, String loc)
      throws RemoteException,AppException;
    }Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
    package com.example;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessSampleEJBBean implements SessionBean {
      public void ejbCreate(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){
      public void createDepartment(int id, String name, String loc) 
      throws AppException {
        // TODO: Implement method here
    }We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
    </ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
       <assembly-descriptor>
          <container-transaction>
             <method>
                <ejb-name>StatelessSampleEJB</ejb-name>
                <method-name>createDepartment</method-name>
                <method-params>
                   <method-param>int</method-param>
                   <method-param>java.lang.String</method-param>
                   <method-param>java.lang.String</method-param>
                </method-params>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
       </assembly-descriptor>
    </ejb-jar>
    Aggregating a BC4J Application Module
    With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
    The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
    // Place to hold onto the aggregated appmodule instance
    transient private ApplicationModule _am  = null;
    // Remember the SessionContext that the EJB container provides us
    private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
    public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
    // JNDI resource name for the J2EE datasource to use
    private static final String DATASOURCE = "jdbc/OracleCoreDS";
    // Fully-qualified BC4J application module name to aggregate
    private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
    public void ejbCreate() throws CreateException {
      try {
        // Setup a hashtable of environment parameters for JNDI initial context
        Hashtable env = new Hashtable();
        env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
        // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
        env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
        env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
        // Create an initial context, using this hashtable of environment params
        InitialContext ic = new InitialContext(env);
        // Lookup a home interface for the application module
        ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
        // Using the home, create the instance of the appmodule we'll use
        _am = home.create();
        // Register the BC4J factory to handle EJB container-managed transactions
        registerContainerManagedTransactionHandlerFactory();
      catch(Exception ex) {
         ex.printStackTrace();
        throw new CreateException(ex.getMessage());
    }and ejbRemove() looks like this:
    public void ejbRemove() {
      try {
        // Cleanup any appmodule resources before getting shutdown
        _am.remove();
      catch(JboException ex) { /* Ignore */ }
    }The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
    private void registerContainerManagedTransactionHandlerFactory() {
      SessionImpl session = (SessionImpl)_am.getSession();
      session.setTransactionHandlerFactory(
        new TransactionHandlerFactory() {
          public TransactionHandler  createTransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
          public JTATransactionHandler createJTATransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
    }The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
    public void createDepartment(int id, String name, String loc)
    throws AppException {
      try {
        // Connect the AM to the datasource we want to use for the duration
        // of this single method call.
        _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
        // Use the "Departments" view object member of this AM
        ViewObject departments = _am.findViewObject("Departments");
        // Create a new row in this view object.
        Row newDept = departments.createRow();
        // Populate the attributes from the parameter arguments.
        newDept.setAttribute("Deptno", new Number(id));
        newDept.setAttribute("Dname", name);
        newDept.setAttribute("Loc", loc);
        // Add the new row to the view object's default rowset
        departments.insertRow(newDept);
        // Post all changes in the AM, but we don't commit them. The EJB
        // container managed transaction handles the commit.
        _am.getTransaction().postChanges();
      catch(JboException ex) {
        // To be good EJB Container-Managed Transaction "citizens" we have
        // to mark the transaction as needing a rollback if there are problems
        _ctx.setRollbackOnly();
        throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
      finally {
        try {
          // Disconnect the AM from the datasource we're using
          _am.getTransaction().disconnect();
        catch(Exception ex) { /* Ignore */ }
    Building a Test Client
    With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
    When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.example.StatelessSampleEJB;
    import com.example.StatelessSampleEJBHome;
    public class SampleStatelessSampleEJBClient {
      public static void main(String [] args) {
        SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
           new SampleStatelessSampleEJBClient();
        try {
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.evermind.server.rmi.RMIInitialContextFactory");
          env.put(Context.SECURITY_PRINCIPAL, "admin");
          env.put(Context.SECURITY_CREDENTIALS, "welcome");
          env.put(Context.PROVIDER_URL,
                  "ormi://localhost:23891/current-workspace-app");
          Context ctx = new InitialContext(env);
          StatelessSampleEJBHome statelessSampleEJBHome =
               (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
          StatelessSampleEJB statelessSampleEJB;
          // Use one of the create() methods below to create a new instance
          // statelessSampleEJB = statelessSampleEJBHome.create();
          // Call any of the Remote methods below to access the EJB
          // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
        catch(Throwable ex) {
          ex.printStackTrace();
    }We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
    // Use one of the create() methods below to create a new instance
    statelessSampleEJB = statelessSampleEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
    System.out.println("Created department 13");
    statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
    System.out.println("Created department 14");
    try {
      // Try setting a department id that is too large!
      statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
    catch (AppException ax) {
      System.err.println("AppException: "+ax.getMessage());
    }Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
    Created department 13
    Created department 14
    AppException: Error creating dept 23456
    JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
    Troubleshooting
    One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS"
        location="jdbc/OracleCoreDS"
        xa-location="jdbc/xa/OracleXADS"
        ejb-location="jdbc/OracleDS"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username="scott"
        password="tiger"
        url="jdbc:oracle:thin:@localhost:1521:ORCL"
        inactivity-timeout="30"
    />This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
    Conclusion
    Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
    Code Listing
    The full code listing for the SampleStatelessEJB bean implementation class looks like this:
    * StatelessSampleEJB
    * Illustrates how to use an aggregated BC4J application module
    * in local mode as part of the implementation of a stateless
    * EJB session bean using container-managed transaction.
    * HISTORY
    * smuench/dmutreja 14-FEB-2002 Created
    package com.example;
    import oracle.jbo.*;
    import oracle.jbo.server.*;
    import javax.ejb.*;
    import oracle.jbo.domain.Number;
    import oracle.jbo.common.PropertyConstants;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
    public class StatelessSampleEJBBean implements SessionBean {
      // JNDI resource name for the J2EE datasource to use
      private static final String DATASOURCE = "jdbc/OracleCoreDS";
      // Fully-qualified BC4J application module name to aggregate
      private static final String APPMODNAME = "com.example.hr.HRApp";
      // Place to hold onto the aggregated appmodule instance
      transient private ApplicationModule _am  = null;
      // Remember the SessionContext that the EJB container provides us
      private           SessionContext    _ctx = null;
      public void ejbCreate() throws CreateException {
        try {
          // Setup a hashtable of environment parameters for JNDI initial context
          Hashtable env = new Hashtable();
          env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
          env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
          env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
          // Create an initial context, using this hashtable of environment params
          InitialContext ic = new InitialContext(env);
          // Lookup a home interface for the application module
          ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
          // Using the home, create the instance of the appmodule we'll use
          _am = home.create();
          // Register the BC4J factory to handle EJB container-managed transactions
          registerContainerManagedTransactionHandlerFactory();
        catch(Exception ex) {
           ex.printStackTrace();
          throw new CreateException(ex.getMessage());
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
      public void createDepartment(int id, String name, String loc)
      throws AppException {
        try {
          // Connect the AM to the datasource we want to use for the duration
          // of this single method call.
          _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
          // Use the "Departments" view object member of this AM
          ViewObject departments = _am.findViewObject("Departments");
          // Create a new row in this view object.
          Row newDept = departments.createRow();
          // Populate the attributes from the parameter arguments.
          newDept.setAttribute("Deptno", new Number(id));
          newDept.setAttribute("Dname", name);
          newDept.setAttribute("Loc", loc);
          // Add the new row to the view object's default rowset
          departments.insertRow(newDept);
          // Post all changes in the AM, but we don't commit them. The EJB
          // container managed transaction handles the commit.
          _am.getTransaction().postChanges();
        catch(JboException ex) {
          // To be good EJB Container-Managed Transaction "citizens" we have
          // to mark the transaction as needing a rollback if there are problems
          _ctx.setRollbackOnly();
          throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
        finally {
          try {
            // Disconnect the AM from the datasource we're using
            _am.getTransaction().disconnect();
          catch(Exception ex) { /* Ignore */ }
      private void registerContainerManagedTransactionHandlerFactory() {
        SessionImpl session = (SessionImpl)_am.getSession();
        session.setTransactionHandlerFactory(
          new TransactionHandlerFactory() {
            public TransactionHandler createTransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();
            public JTATransactionHandler createJTATransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • BC4J Application Module Pooling for JClient App

    Helo,
    i wonder why all documentation about bc4j application module pooling available is for Web app ? (jsp) . I'm creating swing JClient app and i need some doc about how the application module pooling works in this kind of application.
    anybody know where can i get those docs ?
    Need help and Thank you,
    Ricky H.P.

    Connection pooling can be achieved when a JVM instance manages the pool, in 3tiers the Java App. Server has that task.
    If you are 2tiers that means that you are communicating with the database through JDBC.
    When a user launches your JClient app in fact he lauches his own JVM instance so I don't how he could share a pool with other users.
    In your case you have at most 2 open transactions per user.
    You can achieve that by sharing a same binding context with n forms composed of m panels.
    Let's say:
    1 main form
    connection 1: forms a,b,c
    connection 2: forms x,y,z
    In your main form your open your 2 connections and share them.
    You can achieve that by:
    1) in our main form, initialize 2 binding containers
    Example of one:
    DCBindingContainer bc1 = this.createBindingContainer("package name","model name");
    private DCBindingContainer createBindingContainer(String packageName, String panelModelName)
    StringBuffer sb = new StringBuffer(packageName);
    sb.append(ViewConstants.STRING_DOT);
    sb.append(panelModelName);
    DCBindingContainerDef bcdef = DCBindingContainerDef.findDefObject(sb.toString()); //NOTE THE NAME.
    if (bcdef == null)
    throw new JboException("System error, "+getClass().getName()+".createBindingContainer, DCBindingContainerDef: "+sb.toString()+" not found");
    DCBindingContainer bc = bcdef.createBindingContainer(panelBinding.getBindingContext());
    bc.setName(panelModelName);
    panelBinding.getBindingContext().put(panelModelName, bc);
    return bc;
    2) Before that the jbInit method gets called in the called form, set the binding context:
    form1 = new Form1(...);
    form1.setBindingContainer(bc1) ;
    Example of methods in form 1 and form 2:
    public void setBindingContainer(DCBindingContainer ctr)
    this.panelBinding = (JUPanelBinding)ctr;
    setBindingContext(ctr.getBindingContext());
    public void setBindingContext(BindingContext bindCtx)
    if (panelBinding.getPanel() == null)
    panelBinding = panelBinding.setup(bindCtx, this);
    registerProjectGlobalVariables(bindCtx);
    panelBinding.refreshControl();
    try
    System.out.println("Form setBindingContext calling jbInit");
    jbInit();
    panelBinding.refreshControl();
    // FL added
    isBindingContextSet = true;
    System.out.println("Form isBindingContextSet true");
    catch(Exception ex)
    System.out.println("Form setBindingContext exception caught");
    panelBinding.reportException(ex);
    Regards
    Fred

  • How to deploy a BC4J application as a Session Bean to OC4J?

    I want to deploy a BC4J application as an Session Bean to Oracle9iAS Containers for J2EE instead to the 9iAS-DB (= Oracle8i database). How to package the EJB JAR(s), EAR(s), Client JAR(s) ...???
    The main question is: Is it generally possible to deploy/run a BC4J application as an Session Bean to/on Oracle9iAS Containers for J2EE???

    One of the cool things about BC4J framework is the way you can deploy the BC4J application.
    The BC4J application is independent of the deployment mode.
    Irrespective of which mode you actually deploy the applicaiton, you would still get all the framework services.
    It is also easily switchable from one deployment mode to another.
    Today you can decide to deploy it in the local mode and a later stage if you need to deploy it as EJB Session Bean you don't have rewrite your Appplication.
    All you do use the Design Time Wizards for the APplication Module and make it remotable as EJB Session Bean and everything is taken for you.
    BC4J white paper available on technet gives more details
    http://technet.oracle.com/products/jdev/info/techwp20/wp.html
    raghu

  • BUG: Can't create BC4J Application Module Configurations

    Hello,
    I'm using JDev 9.0.3.1 with Win2K and WinXP. There seems to be a bug in the BC4J Application Module Configuration Manager:
    It seems to be impossible to create a new BC4J Application Module Configuration with the Configuration Manager of a BC4J Application Module. I can copy an existing AM configuration, but I can not rename it. Clicking on the OK Button in the Configuration Manager simply does nothing.
    A work around seems to be to open bc4j.xcfg in any text editor, copy an AppModuleConfig element, save xcfg, in JDev remove the project form the workspace, readd it to the workspace (some caching issue of jdev?). Then the new AM config is there and can be modified.
    In JDev 9.0.3 the Config Manager seems to work fine.
    Regards
    Stefan

    The bug is mentioned in metalink bug 2849146.

  • Sharing data among Application Modules & Sessions

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

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

  • Passivation of Application Module before session timeout

    Hi,
    JDeveloper : Studio Edition Version 11.1.2.3.0
    Oracle 11g Database
    WLS - 10.3.5
    I have an application (ADF BC and ADF Faces) built with jsff fragment and I have set user session time out in 4 hours.
    After some time (even before 1 hour of inactivity) I receive following error and unable to work on the page. I have to log out and login again to proceed.
    After approx 20 minutes of inactivity I can see the following log messages:
    <LoopDiagnostic> <dump> [12212] variables variables passivated >>> enterScheduledTimeSheet1_tsDate=2013-05-02
    <LoopDiagnostic> <dump> [12213] variableIterator variables passivated >>> TrackQueryPerformed def
    <LoopDiagnostic> <dump> [12214] variableIterator variables passivated >>> TrackQueryPerformed def
    <LoopDiagnostic> <dump> [12215] variableIterator variables passivated >>> TrackQueryPerformed def
    <LoopDiagnostic> <dump> [12216] variableIterator variables passivated >>> TrackQueryPerformed def
    <LoopDiagnostic> <dump> [12217] variableIterator variables passivated >>> TrackQueryPerformed def
    <DCUtil> <findSpelObject> [12218] DCUtil, returning:oracle.jbo.uicli.binding.JUFormBinding, for com_core_fragments_timesheet2ListingPageDef_com_core_task_flows_timesheet_task_flow_xml_timesheet_task_flow
    <JUCtrlHierNodeBinding> <release> [12219] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_587, value:TimesheetProjectsVO1Iterator
    <JUCtrlHierNodeBinding> <release> [12220] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_588, value:TimeTakenList1Iterator
    <JUCtrlHierNodeBinding> <release> [12221] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_590, value:TbaaTimesheetDailyentryView1Iterator
    <DCIteratorBinding> <releaseDataInternal> [12222] Releasing iterator binding:variables
    <DCIteratorBinding> <releaseDataInternal> [12422] Releasing iterator binding:allClients1Iterator1
    <DCIteratorBinding> <releaseDataInternal> [12423] Releasing iterator binding:allClients1Iterator2
    <ApplicationPoolImpl> <resourceStateChanged> [12424] ApplicationPoolImpl.resourceStateChanged wasn't release related. No notify invoked.
    <ApplicationModuleImpl> <resetState> [12425] Resetting AM=Root
    Is there any way to keep the session alive and keep the application state alive till session times out (4 hours in this case).
    Do I need to setup any other parameters etc.
    Thanks in advance.

    You should read http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcstatemgmt.htm#sm0318 and http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0299 as these parameters control when the application module gets passivated.
    However, if you see this kind of problem it points to a general problem with activation/passivation in your application modules. I strongly recommend that you test your application with application module polling turned off. Then the application module is passivated after each request and errors in this region should pop up even on the developer pc.
    For more info read http://tompeez.wordpress.com/2011/07/08/jdev-always-test-your-app-with-applicationmodule-pooling-turned-off/
    Timo

  • Sharing Application Module view Instances

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

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

  • Sharing view objects across application modules

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

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

  • Call an Application Module deployed as EJB into JServer from a client

    Hi all,
    I've successfully deployed a BC4J Application Module as EJB Session Bean into Oracle8i 8.1.6.
    The deployment descriptor (file LoginModule.dd) starts with the foolowing lines:
    Session Bean ricercalista.server.ejb.LoginModuleServerEJB
    BeanHomeName = "/test/omero/ejb/ricercalista.LoginModule";
    HomeInterfaceClassName = ricercalista.common.ejb.LoginModuleHome;
    RemoteInterfaceClassName = ricercalista.common.ejb.RemoteLoginModule;
    The client code that calls the EJB is:
    import oracle.jbo.*;
    import java.util.Hashtable;
    import javax.naming.*;
    import oracle.jbo.JboContext;
    import ricercalista.common.*;
    import ricercalista.common.ejb.*;
    import ricercalista.UserProfile;
    public class ProvaEJBLogin {
    public static void main(String[] args) throws Exception {
    final String AMDefName = "ricercalista.LoginModule";
    final String Username = "omero";
    final String Password = "omero";
    final String DBUrl = "jdbc:oracle:thin:omero/omero@localhost:1521:OMERO";
    try {
    Hashtable env = new Hashtable(10);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_ORACLE8I);
    env.put(JboContext.HOST_NAME, "bacco08.csr.unibo.it");
    env.put(JboContext.CONNECTION_PORT, "2481");
    env.put(JboContext.ORACLE_SID, "OMERO");
    env.put(JboContext.APPLICATION_PATH, "test/omero/ejb");
    env.put(JboContext.SECURITY_PRINCIPAL, Username);
    env.put(JboContext.SECURITY_CREDENTIALS, Password);
    Context ic = new InitialContext(env);
    LoginModuleHome home = (LoginModuleHome) ic.lookup(AMDefName);
    LoginModule myejb = (LoginModule) home.create();
    myejb.getTransaction().connect(DBUrl, Username, Password);
    myejb.setUser("turronic", "chris");
    System.out.println((String) myejb.getCognome());
    System.out.println((String) myejb.getNome());
    UserProfile up = myejb.getUserProfile();
    for (int i = 0; i < up.size(); i++) {
    System.out.println("dominio = " + up.getCodeDomain(i) + " grado = " + up.getInterestDegree(i));
    myejb.getTransaction().disconnect();
    myejb.remove();
    catch (NamingException ne) {
    System.out.println("Unable to find application " + AMDefName);
    ne.printStackTrace();
    catch (ApplicationModuleCreateException e) {
    System.out.println("Unable to create application module " + AMDefName);
    e.printStackTrace();
    When I run this client, I find the following error:
    "D:\Program Files\Oracle\JDeveloper 3.1.1.2\java1.2\jre\bin\javaw.exe" -classpath "D:\Program Files\Oracle\JDeveloper 3.1.1.2\myclasses;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbojdbcpatch.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboorasql.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbodatum12.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jdev-rt.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\jdbc\lib\oracle8.1.6\classes12.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\connectionmanager.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbomt.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboremote.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jndi.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\xmlparserv2.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\javax_ejb.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboremoteejb.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora_client.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjorb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjapp.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbohtml.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboo8i.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\jswdk-1.0.1\lib\servlet.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Test.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Jelly.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Juggler.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Misc.jar;D:\Program Files \Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Molecule.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Buttons.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\classgen.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboejb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora_client.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjorb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjapp.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\javax_ejb.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjtools.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbj30ssl.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\sqlj\lib\translator.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboremote.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbo8iclient.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora_client.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjorb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjapp.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jndi.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbodatum12.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\java1.2\jre\lib\rt.jar" ricercalista.ProvaEJBLogin
    Diagnostics: Silencing all diagnostic output (use -Djbo.debugoutput=console to see it)
    Unable to find application ricercalista.LoginModule
    [Root exception is java.lang.ClassNotFoundException: ricercalista.common.ejb.LoginModuleHomeHelper]javax.naming.NamingException: Unknown reasons
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.initRemoteHome()
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.<init>(oracle.jbo.JboContext, java.lang.String)
    oracle.jbo.common.JboHome oracle.jbo.client.remote.corba.aurora.AuroraInitialContext.createJboHome(java.lang.String)
    java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void ricercalista.ProvaEJBLogin.main(java.lang.String[])
    What's wrong in my code? Are the Context Properties set correctly? The test on this Application Module works fine. So what's the problem?
    I need your help!
    Tnx!
    null

    I've added libraries LoginModuleEJBClient.jar and EJBGenerated.jar to the client project.
    The error isn't the same, but the following:
    Diagnostics: Silencing all diagnostic output (use -Djbo.debugoutput=console to see it)
    Unable to find application ricercalista.LoginModule
    javax.naming.NamingException. Root exception is java.lang.ClassCastException
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.initRemoteHome()
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.<init>(oracle.jbo.JboContext, java.lang.String)
    oracle.jbo.common.JboHome oracle.jbo.client.remote.corba.aurora.AuroraInitialContext.createJboHome(java.lang.String)
    java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void client.LoginClient.<init>()
    void client.LoginClient.main(java.lang.String[])
    Why is there a ClassCastException?
    Tnx in advance for your help.

  • JAAS Authorization - Application Module

    I created a project based on the BC4J technology. The application module is configured for using the security : jbo.security.enforce=Must. This application module is also configured to deploy the user/password.
    When I used this application through a web application, I don't meet any problem.
    If I create a POJO class in the same project as BC4J in which I instantiate an instance in the application module pool, I receive the following message :
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-33021: Failed authenticate user null.
    The java class in charge of instantiating the application module pool and get an instance of it works without any problem as soon as the security is not implemented.
    Hereafter you can find the method used :
    public ApplicationModule getApplicationModule()
    try{
    PoolMgr poolMgr = PoolMgr.getInstance();
    this.lg_ApplPool = poolMgr.findPool( this.lg_configPackage + "." + this.lg_configName, // name of the pool
    this.lg_configPackage, // name of the package
    this.lg_configName, // name of the configuration
    null);
    // SessionCookie Creation
    String timeStamp = (new java.util.Date()).toString();
    // for web application, replace timeStamp by ip address of the client
    this.lg_Cookie = lg_ApplPool.createSessionCookie(this.lg_applicationId,timeStamp,null);
    CordaEnvInfoProvider lEnvInfoProvider = new CordaEnvInfoProvider ("xxx","xxx");
    // this.lg_Cookie = lg_ApplPool.createSessionCookie(this.lg_applicationId,timeStamp,null);
    this.lg_Cookie.setEnvInfoProvider(lEnvInfoProvider);
    ApplicationModule lAM = this.lg_Cookie.useApplicationModule();
    return lAM;
    catch(Exception e)
    System.out.println("_CrdAppModulePoolMgr - exception : " + e.getMessage());
    e.printStackTrace();
    return null;
    After Having search quite a long time to find a solution, I have no more idea. The only thing I see now is to forget about Jaas if the application module has not to be used by a Java client not being a JClient (Swing) or a Web application.
    Could you let me know if
    1. jaas works with java client not being Swing or web application
    2. if so, could you give me more information about how to work with BC4J application module and security enforce to Must ?
    N.B.
    POJO Client :
    public class TestAppModulePoolMgr
    private ApplicationModule lg_Am = null;
    private CrdAppModulePoolMgr  lgCrdAppModulePoolMgr = null;
    private ApplicationPool lg_ApplPool = null;
    private SessionCookie lg_Cookie = null;
    public TestAppModulePoolMgr()
    this.lg_CrdAppModulePoolMgr = _CrdAppModulePoolMgr.getCrdAppModulePoolMgr();
    this.lg_CrdAppModulePoolMgr.setApplicationId("CrdGenerationAppModuleId");
    this.lg_CrdAppModulePoolMgr.setConfigName("_CrdGenerationAppModuleLocal");
    this.lg_CrdAppModulePoolMgr.setConfigPackage("CORDA_BSV");
    this.lg_Am = lg_CrdAppModulePoolMgr.getApplicationModule();
    this.lg_ApplPool = lg_CrdAppModulePoolMgr.getApplicationPool();
    this.lg_Cookie = lg_CrdAppModulePoolMgr.getApplicationSessionCookie();
    * @param args
    public static void main(String[] args)
    TestAppModulePoolMgr testAppModulePoolMgr = new TestAppModulePoolMgr();
    }

    Thank you.
    I use SSO authentication to test my application so have no users defined.
    Can I use the test-all user? If so, what is the password?

  • Database sessions, Application Modules and Pools

    Hi,
    I have an ADF 10.1.3 application (ADF Faces on ADF BC) that uses JAAS to authenticate it's users. After the user has logged in I would like my session_user_info managed bean to query the database and retrieve all the user's details, for access throughout the user's session. Initially I wrote the following code to achieve this:
          ApplicationModule am = Configuration.createRootApplicationModule(applicationModuleName, applicationConfigName);
          ViewObject vo = am.findViewObject("CurrentUserView1") ;
          vo.setNamedWhereClauseParam("v_userName",userName);
          vo.executeQuery();
          if(vo.getRowCount() <= 0)
            user = null ;
          else
            user = (CurrentUserViewRowImpl) vo.first();
          Configuration.releaseRootApplicationModule(am, true); This works fine BUT because it's creating a new root ApplicationModule each time I end up with an excessive number of database connections after a very short space of time (the call to Configuration.releaseRootApplicationModule does not seem to be releasing the database connection, even though the application module is released). I also don't like this as it feels like I'm "breaking" the framework by making a direct call to the model layer.
    So the next thing I wanted to try was creating a DataControl (by dragging my CurrentUserView1 on to a jspx page, then deleting it to preserve the bindings) and make a call to that using something like this:
            /**** TODO GET BINDING TO CurrentUserView1 ******/
            OperationBinding operationBinding =
                bindings.getOperationBinding("ExecuteWithParams");
            JUCtrlAttrsBinding vUsername =
                (JUCtrlAttrsBinding)bindings.findNamedObject("v_userName");
            statusCode.setAttribute("v_userName", username);
            Object result = operationBinding.execute();
            if (operationBinding.getErrors().isEmpty()) {
               /***** TODO Cast this result object in to something useful *****/
                setUser(result)
            }But as you can see I still don't completely understand what I have to do here (and yes I have trawled the various guides and documentation - but I can't work out exactly what applies to me as this isn't a backing bean).
    If any of you Aces out there can give me some pointers it would be MUCH appreciated as I've beat my head against this for a week now!!
    Dave
    Edited by: Short Dave on Dec 1, 2008 2:52 PM

    John,
    It's been 2 months since I asked this question and in that time I have tried innumerable ways of getting my application and database pools to behave in such a way that doesn't end up filling my database with unclosed sessions. The situation I'd ideally like to achieve is this:
    Application Modules
    A pool of application modules minimum 5 maximum 150 with a "working set" of about 25 (the jbo.recyclethreshold setting)
    For application modules to timeout if they are inactive for > 120 seconds (so if somebody has left their browser open in the background I don't want them hogging my AMs)
    Database Connections +(I am using a JDBC data source to allow multiple applications to reuse my connection pool settings)+
    A pool of database connections minimum 5 maximum 150
    If a connection is inactive for > 300 seconds for that connection to be closed (i.e. if an AM has been returned to the pool, but is not re-used within 5 minutes then I'd like the connection closed)
    Obviously, for the purposes of testing, I don't want to try and manage 150 browser sessions to see if this setup works, so I have been trying to create a scaled-down version of my requirements:
    Application Modules
    A pool of application modules minimum 1 maximum 5 with a "working set" of 1 (the jbo.recyclethreshold setting)
    For application modules to timeout if they are inactive for > 30 seconds
    Database Connections
    A pool of database connections minimum 1 maximum 5
    If a connection is inactive for > 60 seconds for that connection to be closed
    My problem is that, despite all the API's, the ADF for 4GL guide, forum entries and Steve Muench's guide to AM Pooling I still can't get this relatively simple example to work.
    My bc4j.xcfg file looks like (assume all other settings are as default):
             <jbo.recyclethreshold>1</jbo.recyclethreshold>
             <jbo.ampool.maxavailablesize>5</jbo.ampool.maxavailablesize>
             <jbo.ampool.maxinactiveage>30000</jbo.ampool.maxinactiveage>
             <jbo.ampool.minavailablesize>1</jbo.ampool.minavailablesize>
             <ApplicationName>gpl.model.PreUserLoginModule</ApplicationName>
             <jbo.ampool.monitorsleepinterval>30000</jbo.ampool.monitorsleepinterval>My data-sources.xml file has the following entries for the connection used by that application module (assume all other settings are as default):
      <connection-pool name="jdev-connection-pool-gslportal_at_ppmsdb"
                       disable-server-connection-pooling="false"
                       validate-connection="false" inactivity-timeout="60"
                       max-connections="5" min-connections="1"
                       property-check-interval="30"
                       used-connection-wait-timeout="30">With this configuration I can open a maximum of 5 browsers and each one connects successfully. On opening the 6th I get an exception because no more connections are available (as expected). My problem is that if I wait for 5 minutes I'd expect that
    a) 4 of the inactive application modules should be released (with one left available as per the min setting)
    b) The database connections of the 4 inactive application modules should be released as per the "inactivity" and "used-connection-wait" timeouts on the data-source
    c) I'd now expect the 6th browser to be able to connect because of the "freed up" resources
    From what I can make out none of these things happens. Even if I close the original 5 browsers, the 6th still cannot connect.
    I have noticed that if I set the "time-to-live-timeout" for the datasource then this will close the connection after the given period of time, but regardless of whether or not the connection was in use and in doing so renders the application module held in the pool as useless. (So if any of my original 5 sessions attempt to re-use the application module with the closed database connection, a "Closed Connection" SQLException is raised).
    I do appreciate this topic has been given LOTS of forum discussion already - but I really have done my research and am still none the wiser. Any help or guidance will be much appreciated.
    Kind Regards
    Dave

  • BC4J/UIX: Multiple Application Modules / Database Connections

    My UIX application must have access to two databases. One is the main database for the application and the other contains lookup information. The lookup database is shared by many applications of different types. I need to display values in the UIX page and also create a composite view from tables in each database.
    My understanding of this is that a UIX page requires a root Application Module which can have nested application modules allowing construction of a complex application. It appears that a UIX page must be tied to the root Application Module and then the nested modules can be referenced and used later in the UIX page.
    Can I create a root Application Module that contains a nested application module that connects to a different database? If so, are there limitations in building associations between the AM's that use different databases?
    If this is possible, how do I do it? I have created separate projects: one for each of the databases I mentioned and one for the main application module in a separate project. I try to create a "New Business Components Package" and "EJB Entity Facades for existing Entity Beans". The two application modules do not appear. (I created jar files for each of them and referenced these as libraries in the root module project.) Is this the correct approach? I have not found documentation that shows me how to do this yet so I admit I could be completely off base.

    Okay, I figured out that I have to build all of the BC4J packages under the same project and that the EJB Entity Facades is not what I should be working with.
    Maybe I will figure out the rest before too long.

  • How to separate application module instance per user session?

    Hi.
    How do you separate application module instances per session or per user? I am creating a web application and has created a simple filter that implements Filter.
    Thanks in advance.

    Hi Frank. Thank you for the reply.
    I tried using two browsers. The behavior of each page is very much different when being opened individually. Its like the two pages is sharing the same iterator / data and / or entity object. These two pages were opened to see if one is dependent upon the other. But when I test the same scenario on a different computer, everything works out fine.
    Is there a way for me to verify if the sessions are different? and if they are different, is there a way to verify if the application module created a new instance for the other session?

  • Question about shared application modules

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

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

Maybe you are looking for

  • RMAN: Unable to register database

    Hi all, I have just renamed the db_name, dbid and SID of a database using the DBNEWID Utility. When I satrt up the database, it seems to start without any errors. I need to take a backup of this database using RMAN. But when I try to register the dat

  • Solaris Container Manager console does not work

    I've loaded SMC 3.6 and loaded the container manager piece with no problems on a fresh Solaris 10 (11/06) install on a blade 1000. The managment center works just fine. I've loaded the container manager according to the following doc: http://docs.sun

  • Find the program name for a given subroutine

    Hello chaps    I have the name of a subroutine. However i do not know the function group or the module pool in which it is defined. Se84 -> program library -> subobjects does not help. Any other way? Regards Pragnesh

  • Firefox crashes when I save an image

    Whenever I right-click an image and select "Save image as...", Firefox saves the image, then shuts down. This has happened dozens of times. Deleting the download.sqlite file has not worked. A number of different crash IDs have resulted from these cra

  • ABAP Output Report

    Hi everyone. I'm generally using ALV to generate an output. Do you have a different format in creating an output from a report in ABAP? *ALV Format Output ------------------|------------------|------------------------------------|       YEAR