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

Similar Messages

  • Storing Data in Application Module Session

    I'd like to store information about the current user in the session of the application module. I've been examining the example in the ADF Guide for Forms Developers in Chapter 9, but would like to implement it in a more generic way, in an overridden ApplicationModuleImpl class similar to what is documented in Chapter 28.
    What I'd like to accomplish is:
    A generic setter method similar to:
    public void setVariable(String name, String value) {
    Hashtable userdata = getDBTransaction().getSession.getUserData();
    if (userdata == null) {
    userdata = new Hashtable();
    userdata.put(name.toUpperCase(),value.toUpperCase());
    and a getter method similar to
    public String getVariable(String name) {
    Hashtable userdata = getDBTransaction().getSession.getUserData();
    //null handling omitted
    return (userdata.get(name.toUpperCase()).toString());
    I can test this with calls like:
    setVariable("myName","myValue");
    System.out.println("myName="+getVariable("myName"));
    I don't get any errors, but the output is:
    myName=
    Apparently it isn't either storing the value, or it isn't retrieving it correctly. I have several questions about this:
    1. What am I doing wrong here? It 'looks' like it should work, but isn't.
    2. Is this an appropriate approach to this problem?
    3. Will there need to be any special handling on passivation/activation? Or since it's data stored in the session, will the AM handle that for me?

    In further testing I can see that data is getting stored in my hashtable, and if I retrieve it directly in the setVariable method, the retrieval works. What I've discovered though, is that the code:
    getDBTransaction().getSession.getUserData();
    is returning null, in both the getter and setter methods. I am testing this using the application module tester (right click on the AM, click test). Is this default behavior, i.e. should the above line of code return a null value when using the tester?
    Relatedly, am I going to have to write a front-end for this to test against? (please say it isn't so!)

  • 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

  • Sharing data among team members

    We need a system or framework in which it would be easy to implement data sharing among more users.
    We don't want to use a server/client solution. Any suggestions?

    Peer to peer?
    http://www.jxta.org/

  • USING XML FOR EXCHANGING BUSINESS DATA AMONG APPLICATIONS

    HI EVERYONE
    I NEED YOUR ASSISTANCE. I AM DOING A PROJECT
    ON THIS TOPIC BUT HAVE GOT STACK AS TO WHERE
    TO START.
    DO YOU HAVE SOME IDEAS?

    OTN has some sample apps that might interest you:
    [list][*]B2B with XML
    [*]WebStore B2B Exchange
    [*]XML Flight Finder
    [*]Customizing Web Content
    [list]
    Regards,
    -rh

  • 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

  • Best approach to serve same data among many users from POJO DC

    Hi,
    This is a question related to what is the best possible approach for the following scenario.
    A POJO DC that retrieves a collection (of approximately 200 records). The application shows the same records to all application users. The collection needs to be updated from time to time when there are new objects and this needs to be visible to all users in DB.
    Currently, for each user that connects to the application the POJO DC executes the query and deliver results. This works fine when just little amount of users but when several users wants to access the app this become very expensive.
    I am thinking to build a programatically EO - VO and then expose it in a SharedApplicationModule where thanks to the BC Cache I will save and share data among users. I will need to poll make some poll and refresh the collection when new results comes thru.
    Is this a good approach? What are your thoughts or how would be this better implemented?
    Many thanks.
    JDeveloper 12.c

    Hi,
    why do you use a POJO DC at all when the solution is to use a shared ADF BC Application Module?  Sample 156 would become your friend:
    https://blogs.oracle.com/smuenchadf/resource/examples#156
    Frank

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

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

  • Datalogging and Supervisory Control : how to share data among LabVIEW applications on the same network?

    I'm new to DSC. Is there an example program or article about how to share data (live data and data saved after running a program) among LabVIEW (using DSC) that is very basic? I would like to share live data and test reult data (eg. excel) among computers on the same network (may be LAN). Does sharing data over a network by using DSC makes whole system (all computers) down when one computer is locked up?

    Hi,
    The easiest way to network DSC data is using "network tags". The way you do it is by simply configuring the server PC as you normally would do for a local application.
    Then from a remote compute, which we can call a client computer you can go to Tag Configuration Editor and option "File >> Import Network Tags.."
    In the window that opens up you can hit the browse buttom and navigate to your server computer, select the .scf file you want to have and hit the buttom import.
    Save the "client .scf" file locally and now you have in the client the same configuration you have in the server and your data is networked, from there on is just a matter of manipulating the data.
    I hope it helps
    Andre Oliveira

  • Sharing data between two separate user sessions

    Hi all!
    I have been trawling my brain for a solution to this - any help will be appreciated!
    I would like to create a single instance of a class but share that instance over more than one user session (two separate users but both running concurrently).
    Just as you can pass data between sessions using ABAP memory - I would like to pass data (specifically an object reference) between two separate users that could even be logged in to two separate application servers...
    Even a mini Client/server solution would suffice but I cannot figure one out!
    Is this possible?
    Many thanks for your thoughts in advance...
    N

    Hello N K,
    sorry thats not possible. Sharing a data item / object instance requires at least a common physical memory. As this is not guaranteed between different app. server this is technical not possible.
    With release 640 ABAP offers the new feature Shared Objects. These mechanism allows access by different users and some propagation to differnt servers.There is an interesting article on the ABAP SDN homepage
    https://www.sdn.sap.com/sdn/developerareas/abap.sdn
    For relases below more or less the database is the only chance to store data accross application servers (known to me). One exception might be the ENQUEUES which might (mis)used to store some Flags.
    Kind Regards
    Klaus
    Link to Shared Objects PDF
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/shared objects in abap

  • Single session for all Application Modules

    Hello,
    I've got an application that has several Application Modules. All these modules need some data that are set from time to time. I've written some code that calls getSession().getUserData().put("myData",myData). After this method was called in another Application Module i want to retrieve myData with getSession().getUserData().get("myData"). But the result depends if I use 2-tier or 3-tier. In 2-tie I get myData while in 3-tier I get null. My question is:
    Is there a Session object or any other data instance that could be accessed from all Application Modules for on application instance.
    E.g. I've got two user (A,B) who start my application. Through using my app several instance of Application Modules are created. All Application Modules that are created for the instance of User A should be able to share his user name and some other dynamic data while the Application Modules created for B should have no access to that data.
    Doe anybody know if static data of an Application Module are a possible solution?
    regards
    Joerg

    Hi Joerg,
    I am not 100% sure what you are trying to achieve, and with which version of JDeveloper/ ADF, technologies (JSP, Swing), etc, but I can tell you that I have been experimenting with single session accounts myself within a rich-client Swing environment, as I have experienced Oracle DBA guys who want to control user authentication via Oracle accounts (I have achieved this via the JCLoginDialog mechanism, and a bit of a hack)... Frank Nemphius (sp?) posted something about a white paper coming out on a related subject but I don't know where he is with that.
    Anyway, I managed to do it in a prototype by nesting several application modules within a Root Application Module that was essentially simply a Container for the other application modules. Using this mechanism I was able to bind my root application module to any panel I wanted and it would inherit the roots Session.
    ie. I used many application modules and it only used one Oracle Session.
    However, my reservations -
    1) This solution was not tested robustly!
    2) I doubt this would be ideal for a distributed app with thousands of users - My solution is for a very complex app, with a limited number of users.
    Finally, I cannot confirm this is a great solution - I can only tell you it worked in my prototype, and I am currently awaiting the ADF source - when my company and Oracle can decide what level of support we currently have and need!?!? - what exactly does being an "Oracle partner" mean??? Its all very boring and un-interesting to a Java person like me... ;-)
    Once I have the source I will look at how it actually works and perhaps be able to answer questions like this more definitively. Hmm - I wonder if I could get the Oracle JDBC driver source too?? .... Is it written in C or C++?? I know them too... ;-)
    Cheers........Dean

  • Is it proper for an application module has 300 views in the data model?

    Based on my understanding, all view object instances are initialized at the same time as the application module.
    It follows that when an application module is associated with a user session, the queries of each view object in the data model are executed.
    ie. if the data model has 325 view object instances, 325 queries will be executed.
    This doesn't seem efficient:
    1. As each user session only need to access a subset of the view objects (for examples 35 views), the rest of view objects need not be instantiated for that session.
    2. Performance may be slow on executing all 325 queries at one time, even worse when some queries are complex queries.
    Am I correct on this?
    In this case, will it be better to instantiate the view objects using the view object definition at runtime instead of adding all of them to the application module at design time?

    No, that's not the default behaviour.
    Assuming you're talking JDev 11, the AM on it's General tab as a Tuning option where you can set the loading of the VOs to Lazy or Non-Lazy, Lazy is the default. In turn each VO on their General tab also has a Tuning option of similar nature.
    Online documentation says:
    Lazy LoadingSelect to choose lazy loading. In this case, the application module instance is created without any of its components. Your view object and nested application module instances will not load until the first time they are used. For example, when lazy loading is enabled, a view object is instantiated only when the application accesses it. This will make start-up time faster.
    Non-lazy Loading
    Select to choose non-lazy loading. Your view object and nested application module instances will load when the application starts up. For example, suppose the application module you are editing defines three view objects and two nested application modules (which appear in the Application Module Instance section of the Data Model page over the application module overview editor). When lazy loading is disabled, the application module instance is created together with all three view objects and both nested application modules.>
    So in essence as you describe for each session, if we're using the Lazy setting, even though you have 325 VOs within an AM, if the user within the session only visits 35 queries, only 35 queries should fire.
    Does this help?
    CM.

  • Shared applications modules

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

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

Maybe you are looking for