Objects of application scope and clustering.

          I understand that weblogic 6.1 replicates session data to a secondary server in a
          cluster. This replication should include objects declared with <jsp:useBean ...
          scope="session"/> as well as objects that are explicitly maintained in the session
          with setAttribute().
          However, what about objects with application scope? Are they replicated to a secondary
          server when a cluster is in use?
          Thanks,
          -Dave.
          

David Vazquez <[email protected]> wrote:
          > I understand that weblogic 6.1 replicates session data to a secondary server in a
          > cluster. This replication should include objects declared with <jsp:useBean ...
          > scope="session"/> as well as objects that are explicitly maintained in the session
          > with setAttribute().
          > However, what about objects with application scope? Are they replicated to a secondary
          > server when a cluster is in use?
          No, they are not replicated in the cluster. To implement replication you can use JavaGroups:
          http://sourceforge.net/projects/javagroups/ or Cameron's Coherence product:
          http://www.tangosol.com/products-clustering.jsp for example.
          > Thanks,
          > -Dave.
          Dimitri
          

Similar Messages

  • Component in Application Scope and cflock

    Hi,
    I have an CFC that I set in application scope in the
    onApplicationStart method which contains some system parameters,
    one of which is a flag saying whether the site is currently
    "Online". I call a method on this CFC in the Application.cfc
    "onRequest" method to see if the flag value has changed.
    This method looks up a parameter set in the database that
    says whether the site is "online" or "offline". If the site is
    currently online, I want to only redo the query every 5 mins.
    However if the site is offline, I want to check more frequently
    (every 5 secs) as to whether the flag has changed back.
    What I am not sure of, is whether I need to be using
    <cflock> when I change from "online" to "offline"? There is
    only a single instance of this object, but what happens if multiple
    requests are calling the "isSiteOnline" method simultaneously? Is
    this "safe"?
    Some code snippets are attached to illustrate.
    Any advice would be greatly appreciated.
    Regards,
    Andrew.

    > <!--- DO I NEED TO USE CFLOCK HERE???? --->
    No, in either situation.
    Ask yourself... what would the ramifications be of two
    requests hitting
    that line of code "simultaneously"? The end result is that
    both of them
    are setting the variable to the same static value... so
    that's what's going
    to end up happening: variables.instance.cacheInterval is
    going to be set to
    300 (or 5) in each situation.
    You could well with to lock a block of code which - if called
    simultaneously via more than one request - could act on
    shared storage
    space (server, application or session data) differently and
    incorrectly
    than is intended.
    eg:
    <!--- application bootstrap process --->
    <cfif not structKeyExists(application, isInitialised and
    not
    application.isInitialised>
    <!--- initialisation process, whatever it is --->
    <cfif allOK>
    <cfset application.isInitialised = true>
    <cfelse>
    <cfset application.isInitialised = false>
    </cfif>
    </cfif>
    So a sequence of events could be (say the user is hitting the
    site with two
    different browsers):
    REQUEST1: application.isInitialised doesn't exist
    REQUEST1: starts the init process
    REQUEST2: application.isInitialised STILL doesn't exist
    REQUEST2: starts the init process *again*
    REQUEST1: sets the application.isInitialised value
    REQUEST2: sets the application.isInitialised value
    Obviously one does not want two request running the
    initialisation code.
    note this is a slightly contrived example, as if one has an
    OnApplicationStart() method, then it will only run once, and
    that's where
    one would have the init code, but it demonstrates the issue.
    Google "race condition". Those are the situations in which
    one needs to
    lock blocks of code.
    Adam

  • Application coding and clustering

    We are going to develop a web system using iPlanet as web server running http and jsp, weblogic as application server running Java bean RMI inbetween. We have to decide whether to run the app server tire in one box or two(clustered). The idea of having two boxes is because of load balancing andscalability. According to our vendor, application coding (java bean) has to becluster-aware and so there is a price difference. Since we do not havepractical experience on this platform, can somebody please tell me what isthe difference in application coding? How much difference in terms of development efforts? If there is relevant info readilyavailable in the web, please point me the direction.
              

    You are right. But one major problem that web application facing is
              scaleability. such application may have 100 hits in day 1 and 100K hits
              after a week. Using cluster will allow us simply to buy more box and join
              the cluste, and then it will share the load.
              "Mike Reiche" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Less tiers -> less overhead -> less headaches -> less maintenance.
              >
              > If your application can run in a single tier on a single box (even a very
              big
              > box) - then that will be the simplest, most efficient architecture. As
              soon as
              > you run two WL instances vs. two - you've just doubled all your overhead -
              maybe
              > worse, maybe much worse.
              >
              > Mike
              >
              >
              > sender jones <[email protected]> wrote:
              > >We are going to develop a web system using iPlanet as web server running
              > >http and jsp, weblogic as application server running Java bean RMI
              > >inbetween. We have to decide whether to run the app server tire in one
              > >box or two(clustered). The idea of having two boxes is because of load
              > >balancing andscalability. According to our vendor, application coding
              > >(java bean) has to becluster-aware and so there is a price difference.
              > >Since we do not havepractical experience on this platform, can somebody
              > >please
              > >tell me what isthe difference in application coding? How much difference
              > >in terms of development efforts? If there is relevant info
              readilyavailable
              > >in the web, please point me the direction.
              >
              

  • Application Scope Objects and Multithreading

    I will be creating a set of interlinking objects in application scope that are intended for read only. The objects will be accessed every time a user makes a request to the servlet which will be on every link of the site since the servlet is a controller.
    I am pretty sure that there are no concurrency issues here - that all requests will be able to access the objects quickly. Can someone confirm this for me.

    As long as the threads only read information from the objects and do not update them then you should be ok.

  • How can a session scope bean access an application scope bean - help

    Hello,
    I have a JSP page that has references to an Application Scope and a Session Scope bean...
    <jsp:useBean id="myWebApp" scope="application" class="com.my.web.WebApplication" />
    <jsp:useBean id="myWebSession" scope="session" class="com.my.web.WebSession" />
    I would like the WebSession access methods in the WebApplication ... Can/ How does the WebSession object lookup the reference to WebApplication object?

    I don't think you should make the WebSession implement the session listener.
    The session listener will be created once, at the start of the servlet context and would be listening to all sessions. So you would have one instance of the WebSession belonging to the context (though not as an attribute), and others belonging to each session. This will be confusing in your code, I think.
    I would suggest having a different class act as the HttpSessionListener. Perhaps do something like this:
    public class WebSessionInjector implements HttpSessionListener {
      public void  sessionCreated(HttpSessionEvent e) {
        WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
        WebSession mySession = new WebSession();
        mySession.setWebApplication(webApp);
        e.getSession().setAttribute("mySession", mySession);
      public void sessionDestroyed(HttpSessionEvent e) { ... }
    }You may be able to use the WebApplication object itself as the listener ...
    Or, you could make the WebSession implement the HttpSessionBindingListener and use the valueBound event much like the sessionCreated event above, but from inside the WebSession object:
    public class WebSession implements HttpSessionBindingListener {
      public void  valueBound(HttpSessionBindingEvent e) {
        WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
        this.setWebApplication(webApp);
      public void valueUnbound(HttpSessionBindingEvent e) { ... }
    }

  • Is that a good practice to use syncronize methods for application scope cls

    Is that a good practice to use synchronize method in a application scope class, so I have a doubt, there a is class A, it has application scope and it contains a synchronized method add, so because of some network traffic or any unexpected exception client1 got stuck in the method, will that add method available for any other client...?
    Edited by: navaneeth.j on Dec 17, 2009 4:02 AM
    Edited by: navaneeth.j on Dec 17, 2009 4:04 AM

    If it needs synchronization, then it probably doesn't belong in the application scope. Either keep it as is, or reconsider the scope, or make it static.

  • Monitoring of Disabled Application Pools and Websites

    So we have a SCOM 2012 SP1 environment monitoring an IIS server that's Server 2012.  The IIS server has all of the App Pools that are not in use disabled as well the Default website is also disabled.  SCOM unfortunately still picks up that these
    are unavailable and complains ad nauseum.  
    So the real quest is, is the disabled state going to be picked up eventually? (Now two days later the server objects themselves are Healthy, so I assume I can just close the alerts but ...)

    Yes, you can disable alerts of this specific object{Disabled application pools and websites}
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"

  • Locking when using a component as an object in the application scope...

    I have a component that I am building right now that hold
    application settings that are stored in a database table. The
    settings are maintained in a structure "variables.settings" within
    the component and can only be accessed by get and set methods. I
    use the following to create the instance of the object:
    <cfset application.settings =
    createObject("settings","component").init() />
    Now when getting a setting I do not think locking is needed
    as its just reading the value and I am not really concerned with a
    race condition...
    But when using the set method which will update the value of
    the setting.... should I be locking that as technically the object
    is in a shared variable scope? Or is it safe because its within the
    cfc/object?
    If locking is needed, would I need to lock when using the set
    method? or can I just build the lock into the set method so that
    its always there?

    To disagree with craigkaminsky, I think you only need to lock
    if you are
    concerned about race conditions and what could happen during
    a 'dirty
    read' and|or conflicting writes.
    A lot of developers have an old impression of ColdFusion that
    one *must*
    lock all shared scope variable access to maintain a stable
    application.
    This dates from the ColdFusion 4.5 days where there where
    bugs in
    ColdFusion that could cause memory leaks and eventual
    application
    instability if one did not lock shared scope reads and
    writes. This has
    long been fixed, but the advice persists.
    So now it is only a matter of your data and what would happen
    if one
    user read an old value while it was in the process of being
    updated by
    another user. Or could two users be updating the same value
    at the same
    time and cause conflict. If either of those two statements
    are true,
    then yes you should use locking as required by your
    application.
    But if they are both false and it does not matter that user A
    might get
    the old value microseconds before user B changes it. Or there
    is no
    concern with user A changing it once and user B changing it
    again to
    something different moments later without knowing the user A
    has already
    changed it. Then locking is probably unnecessary.
    There can be a cost to over locking shared variable writes
    and|or reads.
    Every time one creates a lock, one is single threading some
    portion of
    ones code. Depending on how the locking is done, this single
    threading
    may only apply to individual users or it may apply to every
    single user
    on the entire server. Either way, too much of this in the
    wrong places
    can create a significant bottle necks in ones application if
    too many
    user requests start piling up waiting for their turn through
    the locked
    block of code.

  • Is Weblogic Cluster  supports Application scope Objects?

              Our Application is mainly depends on Application scope objects. On one m/c, it
              is perfect.
              Now, we want to support the failover , load balancing ... (High Availability).
              I know, weblogic cluster supports HttpSessions, EjbObjects ... etc. What about
              Application scope objects.
              we are planning for weblogic server which supports the our requirements.
              If not, what is the solution to make it work by using Weblogic server.
              for eg: I can give what type of application we are developing --- similar to
              textchat.
              our application is real time application.
              

    Even a singleton is not good enough as singletons are good only in the VM they were
              created it. One way is to have a distributed object such as a stateful session bean of
              which only one instance exists. U can create it at startup and store its handle in
              some persistent storage as well as a singleton. This ensures that even if the
              singleton doesnt contain it the refgerence to it can be obtained.
              There will be some problems with this setup as people should not allow it to create
              instances of it . Any such endeavor will lead to a CacheFullException.
              But essentially that seems possible.
              Even the 2.3 Servlet specification mandates that ServletContext and Application level
              object is only valid inside the JVM which created it. HttpSessions are replicated
              SessionContexts are not and are not likely to be in any J2EE application server
              Sameer
              Devi wrote:
              > One more comment from my side,
              > U mentioned "EXCEPT FOR JNDI" , if this is possible, how can we acheive?
              > Can U give brief description ? Take textchat example itself? since, our application
              > is almost have same mechanism. If it is < 1 sec delay means acceptable for this
              > release.
              >
              > Thanks,
              > Devi
              >
              > "Cameron Purdy" <[email protected]> wrote:
              > >Weblogic doesn't support replicated / synchronized app scope objects
              > >across
              > >a cluster except for JNDI, which is probably not a good solution for
              > >what
              > >you are describing.
              > >
              > >If you need a real-time shared fault-tolerant fail-overable high-performance
              > >load-balanced high-scale data store, then let me know when you find one
              > >;-)
              > >.... seriously, there are not a whole lot of good general purpose solutions
              > >in this space. There are some things to look at but they are all expensive:
              > >
              > >Persistent PowerTier on top of Oracle - a caching entity EJB server
              > >Jasmine (or whatever it is called this week) - an object oriented
              > >distributed data store
              > >....
              > >
              > >Peace,
              > >
              > >--
              > >Cameron Purdy
              > >Tangosol Inc.
              > ><< Tangosol Server: How Weblogic applications are customized >>
              > ><< Download now from http://www.tangosol.com/download.jsp >>
              > >
              > >
              > >"Devi" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> Our Application is mainly depends on Application scope objects. On
              > >one
              > >m/c, it
              > >> is perfect.
              > >> Now, we want to support the failover , load balancing ... (High
              > >Availability).
              > >>
              > >> I know, weblogic cluster supports HttpSessions, EjbObjects ... etc.
              > > What
              > >about
              > >> Application scope objects.
              > >> we are planning for weblogic server which supports the our requirements.
              > >>
              > >> If not, what is the solution to make it work by using Weblogic server.
              > >> for eg: I can give what type of application we are developing ---
              > >similar to
              > >> textchat.
              > >> our application is real time application.
              > >>
              > >
              > >
              

  • Application scope objects(opinions wanted)

    Hi All
    Looking for educated opinions on the pros/cons of application scope objects. I am thinking about creating a read-only application scope hashmap representation of some static data in my database. When queried at the database level it can cause relatively long delays (3-4 seconds) and sometimes must be stored in many sessions on the server. I am thinking just one read-only object stored at app scope will cut down on the waste of memory, as well as skyrocket the speed of retrieving this data.
    Please give me your opinions!!! I can tell you a little more about the app if you need more info to make an educated statement...
    Thanks
    Greg B

    You can use the Properties Object for static data that can be persisted on a filesystem. Also, I assume that you can hold quite a bit of data too. A file read should be faster than a database query. Also if you do the connect once and save the connection for several reads, that works too. The only real slow operation, outside of large resultsets, would be the initial connect.
    I always design up two or three possible solutions and sometimes I protpotype each one. Sometimes one of the tests will prove to be the exact opposite choice of the one you thought would work.
    Now that I have written your response, I think that you could create a custom class to hold data, but would that not just be a copy of the properties object. If it's key/value you need, that's the choice.
    Stand back and ask, "What is the data type of the high level objects?"
    Also, SUN has good articles on almost everything in the JDK.
    David Whitehurst
    [email protected]

  • What are the pros and cons of storing heavely used CFCs in the application scope?

    I've been storing all the required CFCs for a site in the application scope. During onApplicationStart I do something like this application.objSomeCfc =CreateObject('component', 'com.someCfc').init().
    Here is my reasoning.
    Get the CFCs initialized once and stored in memory for better performance.
    Using CreateObject several times on each page load can have a negative impact on performance.
    Having one place to create application scoped CFCs makes it easier to manage code.
    So is my thinking flawed? Are there any additional pros or cons for dealing with CFCs? Is there any docs, articles, blogs, videos, frameworks, ...... that I should check that may change my perspective on how I'm doing this?
    Thanks

    Your approach is fine, depending on how many and what type of CFCs you are talking about. If they are "singletons" - that is, only one instance of each CFC is needed to be in memory and can be reused/shared from multiple parts of your application - caching them in the application scope is common.  Just make sure they are thread safe ("var" or local.* all your method variables).
    You might consider taking advantage of a dependency injection framework, such as DI/1 (part of the FW/1 MVC framework), ColdSpring, or WireBox (a module of the ColdBox platform that can be used independently).  They have mechanisms for handling and caching singletons.  Then you wouldn't have to go to the application scope to get your CFC instances.
    -Carl V.

  • Scope and Objectives of making java swing scientific calculator

    I am going to write code for java swing scientific calculator..... can any body help me to write scope and objectives of this project.... please please :-(

    If this is for school work, then defining the scope is part of the problem. The only advice I will give you is that you only need to implement what the assignment specifies. It is probably intentionally vague so you can bite off way too much and not finish -- failure should teach you something too.
    I had just such an assignment in my software engineering class in college -- create a cross compiler from X to Y where X and Y where known instruction sets. That was the entire assignment -- plus the instruction sets for X and Y. My team looked at the allotted time and resources availabe and decided to do a minimal implementation.
    We where the only team to complete the assignment and all recieved A's because we accurately implemented the required solution and were able to evaluate the real problem--resource allotment--accurately.
    Each other team tried to add "extras" that would "guarantee" them an A grade. In actuallity it was just a lot more work than they could do though and it hurt them in the long run--No matter how good the work was to the point they had at the end of the semester, each student in the other teams only recieved a B or less grade in the class due to failure on that project. Resource allocation and planning--only you can do that for your team/project.

  • Pass these documents a object ID, application and output type..plz help

    Hi frnds,
       To select all the billing documents from from the document flow table i have
    this peice of code----
    SELECT VBELN FROM VBFA INTO CORRESPONDING FIELDS OF TABLE IT_VBFA
             FOR ALL ENTRIES IN ITAB_VBAK WHERE VBELN = ITAB_VBAK-VBELN
                                          AND VBTYP_N = 'C' OR VBTYP_N = 'G'.
    i want to ---Pad two zerou2019s before the document and pass these documents a object ID,
    application and output type.
    Get the object ID, processing status for each billing document number and
    display in the pop up window for the user.
    i hope to use in NAST TABLE.
    how to code this...
    thnx
    daniel
    <LOCKED BY MODERATOR - URGENT, PLEASE HELP OR SIMILAR ARE FORBIDDEN>
    Edited by: Alvaro Tejada Galindo on Aug 18, 2008 1:14 PM

    Use
    declare the field b_vbeln of length u want adding length for 2 '0' also.
    ex:- Vbeln length = 10
           b_vbeln  type i length 12.
    b_vbeln = vbeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = b_vbeln
    IMPORTING
    OUTPUT = b_vbeln.
    U will get b_vbeln with 2 '0' or always the value be of 12 length.

  • Multiple call managers and clusters sharing one application server

    Hi
    I need to program my application such that it can be shared by multiple call managers and clusters. That is, I can only have one application server, and as a result I need to tell my application from which call manager / cluster this "request" is coming from.
    My question is how do we do that? do we have access to some parameters / variables, similar to "#DEVICENAME#", which can be used to pass the call manager identity to the application?
    TIA

    Use multiple instances of your application with different URIs (assuming the instances will not have to talk to each other), then, when configuring the service on each cluster, simply reference the specific URI of the application instance for that cluster. eg: Using Tomcat to host the PhoneMessenger application for Cluster1 and Cluster2, Deploy the same application twice: PhoneMessengerForCluster1 and PhoneMessengerForCluster2. The service URL on Cluster1 might be: http://app_server/PhoneMessengerForCluster1/servlet/PhoneMessenger , and for Cluster2 it could be http://app_server/PhoneMessengerForCluster2/servlet/PhoneMessenger

  • JNDI lookup couldn't find any objects in MBean class and -userThreads issue

    Hi,
    We had used some MBean classes in a jboss j2ee project. Now we need to migrate it to oc4j. We also need to use Thread class and jndi looking up in these MBean classes.
    I encountered two problems when I migrate these MBeans.
    1. The first problem is:
    If I create a InitialContext object just like the following:
    InitialContext result = new InitialContext();
    Then I lookup an ejb,I can't find anything from this InitialContext.
    However,If I create a InitialContext object just like below:
    Properties props = new Properties();
    props.put( Context.PROVIDER_URL, "***" );
    props.put( Context.INITIAL_CONTEXT_FACTORY, "***");
    //props.put( Context.URL_PKG_PREFIXES, "***" );
    props.put( Context.SECURITY_PRINCIPAL, "***");
    props.put( Context.SECURITY_CREDENTIALS, "***" );
    InitialContext result = new InitialContext(props);
    I can find that ejb. Why?
    Is it possible to get InitialContext just like InitialContext result = new InitialContext()?
    2. The second problem is:
    I had used a thread class to do the above mentioned jndi looking up in one MBean method. This method is not be invoked by oc4j EM. It is invoked by another class. There is an exception throws just like below:
    javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    I had add -userThreads argument in the startup command just like below:
    java -Xdebug -Xnoagent -Djava.compiler=NONE -Doc4j.jmx.security.proxy.off=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Dnl=en_US %JAVA_OPTS% %JAVA_SYSPROP% -jar %ORACLE_HOME%/j2ee/home/oc4j.jar
    -userThreads
    Does anyone know why there is an jndi problem in MBean class?
    Thanks,
    Eternal

    Hi,
    We had used some MBean classes in a jboss j2ee project. Now we need to migrate it to oc4j. We also need to use Thread class and jndi looking up in these MBean classes.
    I encountered two problems when I migrate these MBeans.
    1. The first problem is:
    If I create a InitialContext object just like the following:
    InitialContext result = new InitialContext();
    Then I lookup an ejb,I can't find anything from this InitialContext.
    However,If I create a InitialContext object just like below:
    Properties props = new Properties();
    props.put( Context.PROVIDER_URL, "***" );
    props.put( Context.INITIAL_CONTEXT_FACTORY, "***");
    //props.put( Context.URL_PKG_PREFIXES, "***" );
    props.put( Context.SECURITY_PRINCIPAL, "***");
    props.put( Context.SECURITY_CREDENTIALS, "***" );
    InitialContext result = new InitialContext(props);
    I can find that ejb. Why?
    Is it possible to get InitialContext just like InitialContext result = new InitialContext()?
    2. The second problem is:
    I had used a thread class to do the above mentioned jndi looking up in one MBean method. This method is not be invoked by oc4j EM. It is invoked by another class. There is an exception throws just like below:
    javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    I had add -userThreads argument in the startup command just like below:
    java -Xdebug -Xnoagent -Djava.compiler=NONE -Doc4j.jmx.security.proxy.off=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Dnl=en_US %JAVA_OPTS% %JAVA_SYSPROP% -jar %ORACLE_HOME%/j2ee/home/oc4j.jar
    -userThreads
    Does anyone know why there is an jndi problem in MBean class?
    Thanks,
    Eternal

Maybe you are looking for

  • Adobe AIR runtime update dialog breaks application

    I'm working on a large project that utilizes a C++ application to house the core logic and an AIR application to display a UI. The C++ program launches the AIR UI and passes it several command line parameters, including locale and port number to call

  • I want to know how to change schedule on Transport Requests

    Hi. I want to know how to change schedule Transport Requests. And the Transport requests has already approved by Transport Proposals. Now I tried to change schedule after re-creat Transport Request,it is same Transport Request Number. But I can't cha

  • Iphoto updating the thumbnail cache

    I recently installed ilife 06 and I had just moved all my photos over to my recently purchased power mac, and when I opened up iphoto it said it needed to update the thumbnail cache or something like that. Now when I open a photo even outside of ipho

  • Transfer a photo from Macbook running Mavericks to iOS8 iphone

    I've upgraded my iPhone 5S to iOS8 without realising that iPhoto is no longer supported from my MacbookAir running Mavericks. Had I know I would have delayed the upgrade. Today I found out that I can't sync any of my iPhoto albums to my iPhone. This

  • Help! Firmware Problem! Help! Plea

    Ok, I got the Zen Touch off Ebay. I don't have a wall charger, just a USB cord. The battery was almost dead when i got it, but ali've enough to put firmware on it. So i tried putting the newest one on there and it erased the current one on my zen tou