Static variables in OAFramework

Hello

I'm stuck here seriously using static variables in my page. I have developed a few pages in OAFramework. I used more than 200 static variables in all pages. All is well for a single user. If more than 1 user using the page, the values are overlap between users. Now, I realized that its due to declare the values as static. How can I solve this problem?

I would appreciate if someone can me advice on that.


Jim.

First solution to this problem is to convert all static variables to instance variables.
However please provide details of the issue and why it is necessary to make them static.

Abdul Wahid

Tags: Oracle Applications

Similar Questions

  • Access the static variable...

    Hello

    I need a static variable which holds a QMap, for this example I'll use QMap.

    I created fresh new project and I changed in applicationui.cpp:

    ...ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app)
    {
    ....
    
        initDatabase( 1 );
        initDatabase( 2 );
        initDatabase( 3 );
        initDatabase( 4 );
    }
    
    bool ApplicationUI::initDatabase( int index )
    {
        QString database = QString( "Db%1" ).arg( index );
        QString value = QString( "data/db%1.sqlite" ).arg( index );
    
        ApplicationUI::m_databases[database] = value; // undefined reference to `ApplicationUI::m_databases'
    
        return true;
    }
    
    ApplicationUI::~ApplicationUI()
    {
        if( ApplicationUI::m_databases.count() ) // undefined reference to `ApplicationUI::m_databases'
        {
            foreach( const QString &key, ApplicationUI::m_databases.keys() ) // undefined reference to `ApplicationUI::m_databases'
            {
                QString db = ApplicationUI::m_databases[key]; // undefined reference to `ApplicationUI::m_databases'
    
                qDebug() << "Closing [" << db << "]";
            }
        }
    }
    

    and in applicationui.hpp:

    ...
    
    class ApplicationUI : public QObject
    {
        Q_OBJECT
    public:
        ApplicationUI(bb::cascades::Application *app);
        ~ApplicationUI();
    
        static QMap m_databases;
        bool initDatabase( int index );
    ...
    };
    
    #endif /* ApplicationUI_HPP_ */
    

    As you can see commented in the code above, I get error:
    no reference to 'ApplicationUI::m_databases' applicationui.cpp

    I thought to access static variables that ApplicationUI::m_databases would work.

    Can you please guide me here.

    Kind regards

    Andy

    Hello! That's what I saw:

    (1) #include is present in the header file?

    ' (2) ' void ' is the syntax error:

    void MyClass::~MyClass()
    

    3)

    static QMap variable;
    

    is a declaration, you also need to create the variable in the .cpp file. Add to the .cpp:

    QMap MyClass::variable;
    

    4)

    MyClass::variable["one"] = "value One"; // doesn't work...
    

    "MyClass:" is not necessary. ['a'] variable should work too.

    UPD: this compiles (I replaced QMap QString with std::map with std::string for quick test):

    #include 
    #include 
    
    class MyClass
    {
    public:
          MyClass();
          ~MyClass();
    
          void someMethod();
    
          static std::map variable;
    };
    
    std::map MyClass::variable;
    
    MyClass::~MyClass()
    {
         // do some cleanup... using MyClass::variable, doesn't work
    }
    
    void MyClass::someMethod()
    {
         variable["one"] = "value One"; // doesn't work...
    }
    
    int main(void)
    {
            return 0;
    }
    
  • Dreamweaver CS 5 do not support static variables PHP 5.6?

    bug_DV.png

    I don't know what you mean by variables PHP 5.6. I just checked the online PHP manual, static variables are available since PHP 4.

    I also checked some PHP 5.6 features, such as constant expressions and functions variadique in Dreamweaver CC 2015.1. As I suspected, the built-in syntax checker does not support. To my surprise, the latest version of Dreamweaver does support the syntax PHP 5.5 . The syntax checker currently supports only PHP 5.4.

    As when Dreamweaver support the syntax PHP 5.6 or PHP 7.0, Adobe can only say. I'm not an Adobe employee, so I don't know.

  • with respect to an application to turn with the help of a global static variable

    Hello. I've read a few articles on JavaFX competition, and as a beginner, so I have to practice on this subject. Now, I'm trying to implement a turn-based application which can be played between 3 to 6 players. Furthermore, I use a scene from a .fxml file and I need to update it properly depends on certain calculations of each thread (in other word players). My main problem is, I don't want to use a while loop that checks the status of similar game;

    While (GameState! = State.GAME_OVER) {}

    currentPlayer = GameBoard.getNextPlayer ();

    perform certain actions, calculations, etc.

    }

    So, I want to use threads to work instead while loop. I guess only with the help of the Service used to iterate class and assign the next player will be adapted to instead of using the while loop and the tasks for the calculation of each player, or waiting for a few responses of human players on the UI account, however, I am faced with two problems.

    1. It has a global static variable (like the GameState which is an Enumarator) determines the State of the game, so it should be updated and must be verified by each round. Is it possible to do this?
    2. How can I get rid off this while loop?

    I would like for each answer. Thanks anyway.

    It shouldn't make too much difference. The basic idea is that you have a model class that represents your state of the game (the class of game in example jsmith). When a player makes a move, you update the game state. Because this will result in changes to the user interface, this update must be performed on the Thread of the FX Application.

    If the player makes the passage is a human player, the move would be done by a user action (mouse click or press button, etc.); This will be handled on the FX Application thread in any case.

    When the State of the game changes so it is in an "artificial" player's turn to move, have the object representing the artificial player calculate his next move and then update the game state. Since it is a response to the evolution of the game state (it is the artificial player's turn), it will also be on the Thread of the FX Application.

    The only (slight) complexity comes if the calculation of displacement for the artificial player takes a long time. You don't want to perform this calculation of long duration on the Thread of the FX Application. To handle this, the cleaner is to start a task that computes the desired pass and then updates the status of the game when travel is ready. So, something like this:

    GameState game = ... ;
    // UI is bound to the game state.
    ExecutorService executorService = ... ;
    // ...
    
    final Player currentPlayer = game.getCurrentPlayer() ;
    final Task calculateMoveTask = new Task() {
         @Override
         public Move call() {
              Move move = // compute next move...
              return move ;
         }
    };
    
    calculateMoveTask.setOnSucceeded(new EventHandler() {
         @Override
         public void handle(WorkerStateEvent event) {
              gameState.makeMove(currentPlayer, calculateMoveTask.getValue());
         }
    });
    
    executorService.submit(calculateMoveTask);
    

    If you make a thread more than that, you're probably do badly... Also, there should be no need anything it either, will be held in a "global" static variable (the idea above is the only structural change you the example posted by jsmith).

  • Display static Variable for the title.

    Hello
    I have defined a static variable Bank with the value of "Bank of India" in 10g and must mention that in the title. How to set the variable in the title. valueOf ('Bank'), @{biserver.variables ['bank']}, @{'Bank'} do not work, then how?

    Thank you
    Anitha.B

    check with this one - @{biServer.variables [' name ']}
    the variable name must be in a single quote.

    Pls mark if this can help...

  • How to bind static variables?

    In ActionScript, I tried binds a variable to one static variable to another class:

    var watcher: ChangeWatcher = BindingUtils.bindProperty (Thi, "dataProvider", StaticClass, "staticVariable");

    The changewatcher fires when loading, but it fires at all during execution.  And Yes, the static variable has the [Bindable] tag next to it.  I encountered this problem a few times before, and I decided to just go around it.  However, for the sake of clean and efficient code, any help on this would be greatly appreciated.

    See the comments at the bottom of this LiveDocs page:

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=databinding_2.html

    If this post answers your question or assistance, please mark it as such.

  • Definition of static Variables dynamically

    I have an application that instantiates a class several times. Many variables for the class is loaded from a XML when running and may vary each time the program runs, but will not change once the program is running.

    I want to initialize static variables in this category once and then rely on their values through the program. I could do this in the constructor function, but then I think that I do whenever I have to instantiate the class and so will suffer an excessive workload.

    1. is there a way to define static variables once and then let him go without a check in the manufacturer each time to see if they are a null value (and therefore put them)?

    2. do I create an instance of the class to set?

    Any help is appreciated.

    Bob

    > 1. Is there a way to define static variables once and then let it go
    > without
    > a check in the manufacturer each time to see if they are a null value (and
    > so
    (> Set them)?

    Just use dynamic variables. Keep all the in a class as follows:

    class myVariables
    {
    Objects: variables vars private;

    public void readVariable(name:String)
    {
    return variables [name];
    }

    public void myVariables (init:XML = null)
    {
    variables = new Object();

    default init
    variables.xxx = 5;
    variables. ABC = "test";

    If (init)
    {
    set variables for the values passed in the XML strcture;
    }
    }
    }

    MV = new myVariables();
    trace (MV.readVariable ("ABC")); Returns "test".

    You can keep the instance of this class as a global object is accessible for
    other classes without initializing it.

  • Static variables in the Page of the OFA

    Hello

    We have a requirement to show the popup message when changes are made in the page of the OFA. We use the static variable in the OPS page to store the initial values of some fields and whenever the popup needs to be shown, it compares the value of the static variable for the current value. If they are different then we are the message. It works perfectly fine when the page is accessed by the single user. But when several users access a single screen, it shows the message to a user even if the values are not changed by this user, but the other user has changed. My question is-

    1. do we need to use variables of session always for users multiple scenarios?
    2. How does the static variable in java? It is not unique to the session? If so, above the question shouldn't come.
    3. how to solve the problem above?

    Pointers on this would be a great help.

    Thank you
    Shree

    I did not understand the part same page can be accessed by different users. In any OA framework Page, the same page is accessible by several users. If you think abt the same data updated at the same time, then search functionality of Version number of the object in the context of OSTEOARTHRITIS.

    All instances of the VO are unique for each session. So no need to worry about this side here.

    Concerning
    Sumit

  • How can I set a static variable with another variable?

    Is it possible to do this? I want to have a Static String variable that has a part of the dynamic string based on another variable. I know that probably sounds ridiculous, then, if so, give a suggestion concerning best practices in what I'm trying to do.

    Thank you.

    He is the dumbest question ever. Just ignore me.

  • What is the best way to copy a static variable of C in LabVIEW?

    As an interesting project / fun, I'm trying to implement the bcrypt algorithm in some native G, without using libraries (for example, no link DLL, all of the native code G). Everything is going well so far, with the exception of a minor roadblock I ran into. The bcrypt algorithm involves initialization of a state variable with a range of 4 x 256 of hex codes derived the decimals of pi. In C code, it looks like:

    unsigned int BF_init_state = {}
    {
    {
    Initial state of the line 1s
    }, {
    Initial state of the line 2 S
    }, {
    Initial state of the 3 S-line
    }, {
    Initial state of the line 4S
    }
    }, {
    State initial P goes here
    }
    };

    I know that this should be in favour of some sort of import JSON, or perhaps directly via the menu data operations, but I'm not 100% sure on the best way to do it. Any ideas?

    I truncated lines, so if you are interested in getting the complete code, see crypt_blowfish.c on GitHub.

    This will make only a row/column at a time, but I think that's what you're looking for.

  • Performance of Modbus using DSC static Variables

    I'm fairly new to using Modbus with LabVIEW.  On some dozens tools and APIs that can be used for a project, I train, I decided to try using an alias of shared Variables in Modbus registers in the project, which is a tool of DSC.  It seemed like a smart to go way.  I used Variables shared in the past, however, and I am aware of some of the questions that surround them, especially when the number of them begins to increase.  I will have only about 120 variables, so I don't think that's not too bad, but I'm getting a little worried...

    The way I started to do this was to create a new shared variable for each data point.  What I have noticed since then is that there is a mechanism to process multiple records at once using a table of values.  (Unfortunately, even if I wanted to use the table method, I probably couldn't.)  Modbus points that I am interfacing are for a custom device and the programmer does not disturb the consecutive use records...)  But anyway, I was wondering what might be performance issues that surround this API.

    I guess:
    (1) all caveates of shared variables apply.  These are really shared variables, but only DSC taught the engine of the SV to go read.  Is this fair?

    And I wonder:

    (2) there is no improvement in performance for reading a table of variables consecutive rather than reading each variable individually?

    (3) there performance above problems what shared variables have normally when you use Modbus specifically?  (E.g. how many times can you read a few hundred points of the device even Modbus?)

    Thank you

    DaveT

    Hi Dave,.

    Thanks for your good questions!

    (1) you are right that the caveates of shared variables apply. Generally, the major issues (conditions of race etc.) are not met because these variables are generally used as I/O.

    (2) with a large number of shared variables that are located on separate machines, it is best to use a table. However, with 120 variables read consecutively will not affect your overall performance, especially if you don't need to read everything at the same time.

    (3) overall, there is no any concerns of performance outside normal common variable concerns. Modbus and DSC are designed to be efficient and do a good job to maximize performance for you.

    I hope this helps.

    Best regards

    Anna L

  • vs flow network static variable

    I send a RT PXI system data users on different computers from Windows via the shared Variable and network data stream.  The user who receives the data via the network stream writes the data to a disk file (data acquisition computer alias).  Users who receive the data through the shared Variable the poster on the front panels (a.k.a. watchers).

    The data consists of a 1-d SGL table where elements 0-3 are the timestamp, element 4 is the counter and elements 5-1000 + are given.  The timestamp is the time GPS and is displayed on all computers.  When I look at the timestamp on the DAQ he slowly falls behind the hour GPS.  After 4 hours, it may be up to one minute behind.  When I look at the timestamp on the observers, it's always the time display GPS.  When I look at the code on the PXI system, he sends always time GPS.  The counter on the computer of data acquisition is also behind.

    I use the functions to read/write single item stream with buffer size of read/write by default 4096.  The output "timed out?" is always FALSE for the two functions.  No errors are generated.  LabVIEW memory usage is constant during the time.

    On RT PXI system the network stream and shared variables are written on inside a timed While loop.  Users to read the data in a standard While loop.  Everyone is using LabVIEW 2011.

    Looks like a buffer is slowly being filled somewhere, but where?

    The network stream buffer was used too quickly upwards.  Thus, increase buffer size and/or insert the small waiting.

  • Deployment complete with static Variables cRio-9074 network errors, pc with executable file

    Hello.

    I am building an application runs on a machine without LabVIEW development system and connect via the network shared a cRIO Varibles (RT FIFO). I can successfully create an installer and EXE for PC and a RTEXE for the cRio. When I run on my development computer, the application is able to communicate using variables shared without a problem.

    But, when I install my application on another computer and connect the cRIO, I get the following error when you deploy shared variables when the application starts:

    Initializing...

    Calculating dependencies...

    The checking for conflicts. This operation can take a long time.

    Preparation itesm by download. This operation can take a long time.

    Deployment 169.254.84.198

    Deployment VariableLib.lvlib\\169.254.84.198\VariablesLib (:-2147467259,)

    LabVIEW: Unspecified error (Hex 0 x 800004005).).

    Completed with errors of deployment

    I created an exception in the Windows Firewall configuration. I have included the library of VariableLib on the EXE of RT, outside and inside the exe file to c:\.

    I am downloading the SP1 for LabVIEW and Module RT and decided to reinstall all the software on my cRio.

    Any help will be appreciated.

    Hello Luis.

    Thank you very much for your help. The Variable engine OR has been and should be included in the intallation.

    I was able to get the application running. I installed the System Manager distributed on the PC without LabVIEW to control if the library has been get deployed. Using what I found that another device on the network use the same IP address as the cRio and so the IP address has been lying to the deployment, but the device has returned an error. I just changed the IP address on the cRio and I was good to go. I have not reproduced on both devices such as network shared Variables suggests on some positions, nor I needed to modify the ALIAS files on devices.

    Best regards and thanks again for your time.

  • Link static variables programmatically

    I'm trying to link the shared variables programmatically, but I can't work properly. My goal is to reuse a Panel before working with several groups of shared variables (implementation of facades in a SCADA solution).

    Anyone know what is the right solution to achieve success?

    Enclosed please find my last attempt failed, no errors, but does not.

    Examples or assistance will be appreciated. Thank you.

    Hi Sendia,

    Thank you for your quick response. I have the DSC module, and as shown in the link above, I achieved the following results:

    * If running the LabView application, solution works, but not correctly, every time I change a shared variable, binding the following error appears (once), see SV_Binding_Error.PNG

    * If running the compiled stand-alone application (.exe), whenever I have change a shared variable not binding no errors appear, but there is no change in data binding.

    Best regards.

  • NullPointerException odd of static variable

    I have a weird PVR for the next part of the code
    public class DefaultConnectionHandler extends ConnectionHandlerImpl
    {
        public void run()
        {
    ...
            catch (Throwable t)
            {
                if (severity == null)
                {
                    severity = ResultSeverity.FAILURE;
                }
                c_log.error("Unexpected exception handling connection", t);
            }
    c_log is a log4j Logger (1,3) defined in ConnectionHandlerImpl
    public abstract class ConnectionHandlerImpl implements ConnectionHandler
    {
        protected static Logger c_log = Logger.getLogger(DefaultConnectionHandler.class);
    ...
    The NPE watch the line c_log as the first line of stack dump - now I can't understand how this can be possible. As far as I know, log4j will not return null for getLogger(), so c_log cannot be null. This occurred when the virtual machine is shut down, so is there any chance of the VM may unload classes while there are still instances of this class, or is the only anwer as getLogger MUST have returned a null value. It's Java 6 u23.

    Published by: EJP on 31/03/2011-11:06: adding code tags. Please use them.

    848753 wrote:
    c_log is not final, but it has not assigned anywhere else. It is widely used in the proceeding, but I'm trying to get hold of the complete log to see if the log messages have been generated by it before the NEP, but I expect they'll wake up :(

    I meant in the constructor, it calls

    this.server = server;
    server.registerTransport(transport);
    

    It is not definitive, but it's the only place wherever it is assigned.

    Make final. It is possible (but unlikely) that a thread is attribution, and since it is not final, another thread is only see its cached - the value null by default value. Makes the final will be correctly the problem if that's it, or at the very least, eliminate it is a candidate and possible source of other problems in the future.

Maybe you are looking for

  • Satellite L50-B-1JQ - Radeon R7 M260 working on x 4 32-bit bus only?

    Hey guys,. I plug just this Toshiba and expected a lot more of the dedicated graphics card. Landmarks were weak and GPU - Z indicates the card using a 32-bit bus while, for example gpu dedicated 5 years of my laptop cheap used a 64 bit one. GPU - Z i

  • How to use a map series R w Teststand?

    You put the 'Host' vi in Teststand as said that tests a numerical limit?  The host load the FPGA VI in every time his name in TS?  The FPGA VI have to compile each time so that the user must wait? Thank you

  • How to format the old computer

    My grandson bought this old computer. I tried to format it for him he says impossible to format. file in us.  IAM lost don, t know what to do.

  • Signature as a Director & administrator password

    I have Windows XP, Service Pack 3.  While trying to solve some problems with my computer, it asks me to log on as an administrator and enter the administrator password.  I don't know how to do this, or if an administrator password was already impleme

  • I received 2 calls today from someone speaking very rugged sayng they are Microsoft English

    original title: Microsoft calls Today, I received 2 calls from someone speaking very rugged sayng English they are from Microsoft and that they receive the error messages from my computer.  I told them that I wanted someone to call me that their moth