Search Results

Search found 110 results on 5 pages for 'stateful'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • Is RTD Stateless or Stateful?

    - by [email protected]
    Yes.   A stateless service is one where each request is an independent transaction that can be processed by any of the servers in a cluster.  A stateful service is one where state is kept in a server's memory from transaction to transaction, thus necessitating the proper routing of requests to the right server. The main advantage of stateless systems is simplicity of design. The main advantage of stateful systems is performance. I'm often asked whether RTD is a stateless or stateful service, so I wanted to clarify this issue in depth so that RTD's architecture will be properly understood. The short answer is: "RTD can be configured as a stateless or stateful service." The performance difference between stateless and stateful systems can be very significant, and while in a call center implementation it may be reasonable to use a pure stateless configuration, a web implementation that produces thousands of requests per second is practically impossible with a stateless configuration. RTD's performance is orders of magnitude better than most competing systems. RTD was architected from the ground up to achieve this performance. Features like automatic and dynamic compression of prediction models, automatic translation of metadata to machine code, lack of interpreted languages, and separation of model building from decisioning contribute to achieving this performance level. Because  of this focus on performance we decided to have RTD's default configuration work in a stateful manner. By being stateful RTD requests are typically handled in a few milliseconds when repeated requests come to the same session. Now, those readers that have participated in implementations of RTD know that RTD's architecture is also focused on reducing Total Cost of Ownership (TCO) with features like automatic model building, automatic time windows, automatic maintenance of database tables, automatic evaluation of data mining models, automatic management of models partitioned by channel, geography, etcetera, and hot swapping of configurations. How do you reconcile the need for a low TCO and the need for performance? How do you get the performance of a stateful system with the simplicity of a stateless system? The answer is that you make the system behave like a stateless system to the exterior, but you let it automatically take advantage of situations where being stateful is better. For example, one of the advantages of stateless systems is that you can route a message to any server in a cluster, without worrying about sending it to the same server that was handling the session in previous messages. With an RTD stateful configuration you can still route the message to any server in the cluster, so from the point of view of the configuration of other systems, it is the same as a stateless service. The difference though comes in performance, because if the message arrives to the right server, RTD can serve it without any external access to the session's state, thus tremendously reducing processing time. In typical implementations it is not rare to have high percentages of messages routed directly to the right server, while those that are not, are easily handled by forwarding the messages to the right server. This architecture usually provides the best of both worlds with performance and simplicity of configuration.   Configuring RTD as a pure stateless service A pure stateless configuration requires session data to be persisted at the end of handling each and every message and reloading that data at the beginning of handling any new message. This is of course, the root of the inefficiency of these configurations. This is also the reason why many "stateless" implementations actually do keep state to take advantage of a request coming back to the same server. Nevertheless, if the implementation requires a pure stateless decision service, this is easy to configure in RTD. The way to do it is: Mark every Integration Point to Close the session at the end of processing the message In the Session entity persist the session data on closing the session In the session entity check if a persisted version exists and load it An excellent solution for persisting the session data is Oracle Coherence, which provides a high performance, distributed cache that minimizes the performance impact of persisting and reloading the session. Alternatively, the session can be persisted to a local database. An interesting feature of the RTD stateless configuration is that it can cope with serializing concurrent requests for the same session. For example, if a web page produces two requests to the decision service, these requests could come concurrently to the decision services and be handled by different servers. Most stateless implementation would have the two requests step onto each other when saving the state, or fail one of the messages. When properly configured, RTD will make one message wait for the other before processing.   A Word on Context Using the context of a customer interaction typically significantly increases lift. For example, offer success in a call center could double if the context of the call is taken into account. For this reason, it is important to utilize the contextual information in decision making. To make the contextual information available throughout a session it needs to be persisted. When there is a well defined owner for the information then there is no problem because in case of a session restart, the information can be easily retrieved. If there is no official owner of the information, then RTD can be configured to persist this information.   Once again, RTD provides flexibility to ensure high performance when it is adequate to allow for some loss of state in the rare cases of server failure. For example, in a heavy use web site that serves 1000 pages per second the navigation history may be stored in the in memory session. In such sites it is typical that there is no OLTP that stores all the navigation events, therefore if an RTD server were to fail, it would be possible for the navigation to that point to be lost (note that a new session would be immediately established in one of the other servers). In most cases the loss of this navigation information would be acceptable as it would happen rarely. If it is desired to save this information, RTD would persist it every time the visitor navigates to a new page. Note that this practice is preferred whether RTD is configured in a stateless or stateful manner.  

    Read the article

  • Stateful EJBs in web application?

    - by Sebastien Lorber
    Hello I never used stateful EJBs. I understand that a stateful EJB can be useful with a java client. But i wonder: in which case to use them on a web application? And how? Should we put these stateful beans in Session (because of stateless http)? Is it a good practice? (without debating too much about stateful vs stateless)

    Read the article

  • Stateful vs. Stateless Webservices

    - by chrsk
    Imagine a more complex CRUD application which has a three-tier-architecture and communicates over webservices. The client starts a conversation to the server and doing some wizard like stuff. To process the wizard the client needs feedback given by the server. We started a discussion about stateful or stateless webservices for this approach. I made some research combined with my own experience, which points me to the question mentioned later. Stateless webservices having the following properties (in our case): + high scalability + high availability + high speed + rapid testing - bloated contract - implementing more logic on server-side But we can cross out the first two points, our application doesn't needs high scalability and availability. So we come to the stateful webservice. I've read a bunch of blogs and forum posts and the most invented point implementing a stateful webservice was: + simplifies contract (protocol) - bad testing - runs counter to the basic architecture of http But doesn't almost all web applications have these bad points? Web applications uses cookies, query strings, session ids, and all the stuff to avoid the statelessness of http. So why is it that bad for webservices?

    Read the article

  • Strange problem with SEAM stateful session bean

    - by John
    Hi, I've got a staeful session bean. @Scope(ScopeType.SESSION) @Name("chuckNorrisBean") public class ChuckNorrisBean implements Serializable, ChuckNorris with some function public void roundHouseKick() { ... } interface @Local public interface ChuckNorris { public void roundHouseKick() { ... } } and calling them on a jsf .xhtml page using #{chuckNorrisBean.roundHouseKick} which works perfectly fine. However if I add the @Stateful annotation to the bean so it becomes @Stateful @Scope(ScopeType.SESSION) @Name("chuckNorrisBean") public class ChuckNorrisBean implements Serializable, ChuckNorris and the page will load with exceptions complainig about Exception during request processing:Caused by javax.servlet.ServletException with message: "#{chuckNorrisBean.roundHouseKick}: javax.el.MethodNotFoundException: //localhost/universe/earth.xhtml @41,65 action= "#{chuckNorrisBean.roundHouseKick}": Method not found: ChuckNorrisBean:a6gkg-w6das4-g8wmgh0y-1-g8woy0wo-4b.roundHouseKick()" Any advice on what might've went wrong with my chuckNorrisBean? The system is built on SEAM/richfaces. Thanks!

    Read the article

  • Wicket: stateless AJAX behaviors in stateful page without serialization

    - by mschayna
    I have pretty stateful page with plenty of AJAX components. Most of these components have behaviors, which renders JavaScript code for calling AJAX requests to Java code. Because page isn't stateless, each request causes serialization of page. So far so good. But some of these AJAX requests doesn't change page ever, so serialization of page isn't necessary. For example it is forward caching data for (home-brewed) datagrid component. These requests are calling continuously and serialization of page during each request causes delays. There are some projects for stateless wicket components out there, e.g. wicket-stateless, but it solves another situation -- request of stateless components are processed on new instances of stateless pages. I want to process requests on existing stateful page instance but without serialization. I have tried to implement this in my own RequestCycleProcessor.resolve(), but I hung on searching for page from requestParameters because Session.getPage() always touches page and it causes serialization after request processing. Is there any example, idea, whatever for implementing this in Wicket? Hope it's understandable :)

    Read the article

  • What's the difference between stateful and stateless?

    - by Pankaj Upadhyay
    The books and documentation on the MVC just heap on using the Stateful and Stateless terms. To be honest, i am just unable to grab the idea of it, what the books are talking about. They don't give an example to understand any of the either state, rather than just telling that HTTP is stateless and with ASP.NET MVC microsoft is going along with it. Am I missing some fundamental knowledge, as i can't understand what is stateful and why is stateful and same goes for stateless. A simple and short example that talks about a control like button or textbox can be simplify the understanding i suppose.

    Read the article

  • Side effect-free interface on top of a stateful library

    - by beta
    In an interview with John Hughes where he talks about Erlang and Haskell, he has the following to say about using stateful libraries in Erlang: If I want to use a stateful library, I usually build a side effect-free interface on top of it so that I can the use it safely in the rest of my code. What does he mean by this? I am trying to think of an example of how this would look, but my imagination and/or knowledge is failing me.

    Read the article

  • How to use JNDI to obtain a new Stateful Session Bean, in EJB3?

    - by FarmBoy
    I'm trying to use JNDI to obtain a new Stateful Session Bean in a servlet (as a local variable). My doGet() method has the following: Bean bean = (Bean) new InitialContext().lookup("beanName"); I've tried including java:comp/env but all of my attempts have led to naming exceptions. I'm attempting to bind the bean in the @Stateful annotation, using various guesses like @Stateful(name="beanName") and @Stateful(mappedName="beanName")

    Read the article

  • Set up a GUI managed stateful filtering firewall?

    - by Azendale
    What ways are there of setting up a stateful filtering* firewall whose rules can be managed by a GUI? Can GUFW do it? FireStarter? (or should that be avoided because it is supposedly no longer updated?) *By filtering, I'm mean the traffic I am setting rules up for is not destined for this computer. It is either from or to other computers on my LAN. Say, for (a simplified, hypothetical) example: I have an ethernet connection at my dorm that I have plugged into eth0. It gets an address of 192.168.1.185 and I also have 192.168.185.0/24 routed to me, so I don't have to do any NAT. I have a hub attached to my second ethernet port (eth1) with a few Windows computers and I give addresses out of my 192.168.185.0/24 block with DHCP. How can I use my Ubuntu box to block incoming connections from eth0 that are being routed to my Windows computers and let through just a few specific ports (so fellow students can't see what files my Windows boxes are sharing via SMB)?

    Read the article

  • What's the situation that requires stateful firewall?

    - by Eonil
    I just know there is two kind of firewalls. Stateless and stateful. It's hard to determine what kind of firewall I have to use. Currently I have to run firewall within same machine runs services, Basically I want stateless because of its less resource consumption. However if it is not sufficient for security, it's meaningless. I'll run HTTP, SSH, NFS (only over SSH), and some custom made server on several TCP/UDP ports. Should I use stateful firewall? (edit) Maybe the question can be assumed as 'Should I use stateful rules?'.

    Read the article

  • ASP.NET client to stateful java webservice client (metro)

    - by hubertg
    Hi I have a webservice with the following annotations: @WebService @HttpSessionScope @Stateful @Addressing Now I created a ASP.NET (c#) client for this webservice, but when I call a method the following error is returned: This is a stateful web service and {http://jax-ws.dev.java.net/xml/ns/}objectId header is required. How can I tell ASP.net to switch to stateful mode? Is this possible at all? Thanks any advice/examples.

    Read the article

  • Functional programming and stateful algorithms

    - by bigstones
    I'm learning functional programming with Haskell. In the meantime I'm studying Automata theory and as the two seem to fit well together I'm writing a small library to play with automata. Here's the problem that made me ask the question. While studying a way to evaluate a state's reachability I got the idea that a simple recursive algorithm would be quite inefficient, because some paths might share some states and I might end up evaluating them more than once. For example, here, evaluating reachability of g from a, I'd have to exclude f both while checking the path through d and c: So my idea is that an algorithm working in parallel on many paths and updating a shared record of excluded states might be great, but that's too much for me. I've seen that in some simple recursion cases one can pass state as an argument, and that's what I have to do here, because I pass forward the list of states I've gone through to avoid loops. But is there a way to pass that list also backwards, like returning it in a tuple together with the boolean result of my canReach function? (although this feels a bit forced) Besides the validity of my example case, what other techniques are available to solve this kind of problems? I feel like these must be common enough that there have to be solutions like what happens with fold* or map. So far, reading learnyouahaskell.com I didn't find any, but consider I haven't touched monads yet. (if interested, I posted my code on codereview)

    Read the article

  • How do I obtain a new stateful session bean in a servlet thread?

    - by FarmBoy
    I'm experimenting with EJB3 I would like to inject a stateful session bean into a servlet, so that each user that hits the servlet would obtain a new bean. Obviously, I can't let the bean be an instance variable for the servlet, as that will be shared. And apparantly injecting local variables isn't allowed. I can use the new operator to create a bean, but that doesn't seem the right approach. Is there a right way to do this? It seems like what I'm trying to do is fairly straightforward, after all, we would want each new customer to find an empty shopping cart.

    Read the article

  • Remove stateful EJB bean in client

    - by palto
    I'm currently learning EJB and as I understand when client gets a stateful session bean the server keeps it in memory(or passivates it) until the client removes the bean. Pretty simple, except nowhere I have seen any examples of how the client can actually remove the bean. How do you do that other than shutting down your client application? Or do I just have to implement a reset method in all my stateful beans if I want to start over?

    Read the article

  • Stateful Iterators Java

    - by Gitmo
    What is a Stateful Iterator? This question relates to an Iterator defined in Hadoop for performing Joins. As the reference documentation states: This defines an interface to a stateful Iterator that can replay elements added to it directly. Note that this does not extend Iterator. What does 'replay elements added to it directly' mean? How is this iterator different from a usual iterator?

    Read the article

  • new Stateful session bean instance without calling lookup

    - by kislo_metal
    Scenario: I have @Singleton UserFactory (@Stateless could be) , its method createSession() generating @Stateful UserSession bean by manual lookup. If I am injecting by DI @EJB - i will get same instance during calling fromFactory() method(as it should be) What I want - is to get new instance of UserSession without preforming lookup. Q1: how could I call new instance of @Stateful session bean? Code: @Singleton @Startup @LocalBean public class UserFactory { @EJB private UserSession session; public UserFactory() { } @Schedule(second = "*/1", minute = "*", hour = "*") public void creatingInstances(){ try { InitialContext ctx = new InitialContext(); UserSession session2 = (UserSession) ctx.lookup("java:global/inferno/lic/UserSession"); System.out.println("in singleton UUID " +session2.getSessionUUID()); } catch (NamingException e) { e.printStackTrace(); } } @Schedule(second = "*/1", minute = "*", hour = "*") public void fromFactory(){ System.out.println("in singleton UUID " +session.getSessionUUID()); } public UserSession creatSession(){ UserSession session2 = null; try { InitialContext ctx = new InitialContext(); session2 = (UserSession) ctx.lookup("java:global/inferno/lic/UserSession"); System.out.println("in singleton UUID " +session2.getSessionUUID()); } catch (NamingException e) { e.printStackTrace(); } return session2; } } As I understand, calling of session.getClass().newInstance(); is not a best idea Q2 : is it true? I am using glassfish v3, ejb 3.1.

    Read the article

  • Long running stateful service in .NET

    - by Asaf R
    Hi, I need to create a service in .NET that maintains (inner) state in-memory, spawns multiple threads and is generally long-running. There are a lot options - Good-old Windows Service Windows Communication Services Windows Workflow Foundation I really don't know which to choose. Most of the functionality is in a library used by this service, so the service itself is rather simple. On one hand, it's important the service host is as close to "simply working" as possible, which excludes Windows Service. On the other hand, it's important that the service is not taken down by the host just because there's no external activity, which makes WCF kind o' "scary". As for WF, it's strongest selling point is the ability to create processes as, um..., workflows, which is something I don't need nor want. To sum it up, the plethora of Microsoft technologies got me a bit confused. I'd appreciate help regarding the pros and cons of each solution (or other's I've failed to mention) for the problem of a stateful, long running service in .NET Thanks, Asaf P.S., I'm using .NET 4. EDIT: What I mean by the host "simply working" is, for example, that the service I create be reactivated if it crashes. I guess the reason for this question is that I've created Windows Services in the past (I think it was in plain C++ with Win32 API), and I don't want to miss out on something simpler if there's is such as thing. Thanks for all the replies thus far! Asaf.

    Read the article

  • multiple stateful iframes per page will overwrite JSESSIONID?

    - by Nikita
    Hello, Looking for someone to either confirm or refute my theory that deploying two iframes pointing to two different stateful pages on the same domain can lead to JSESSIONIDs being overwritten. Here's what I mean: Setup suppose you have two pages that require HttpSession state (session affinity) to function correctly - deployed at http://www.foo.com/page1 and http://www.foo.com/page2 assume www.foo.com is a single host running a Tomcat (6.0.20, fwiw) that uses JSESSIONID for session id's. suppose these pages are turned into two iframe widgets to be embedded on 3rd party sites: http://www.site.com/page1" / (and /page2 respectively) suppose there a 3rd party site that wishes to place both widgets on the same page at http://www.bar.com/foowidgets.html Can the following race condition occur? a new visitor goes to http://www.bar.com/foowidgets.html browser starts loading URLs in foowidgets.html including the two iframe 'src' URLs because browsers open multiple concurrent connections against the same host (afaik up to 6 in chrome/ff case) the browser happens to simultaneously issue requests for http://www.foo.com/page1 and http://www.foo.com/page2 The tomcat @ foo.com receives both requests at about the same time, calls getSession() for the first time (on two different threads) and lazily creates two HttpSessions and, thus, two JSESSIONIDs, with values $Page1 and $Page2. The requests also stuff data into respective sessions (that data will be required to process subsequent requests) assume that the browser first receives response to the page1 request. Browser sets cookie JSESSIONID=$Page1 for HOST www.foo.com next response to the page2 request is received and the browser overwrites cookie JSESSIONID for HOST www.foo.com with $Page2 user clicks on something in 'page1' iframe on foowidgets.html; browser issues 2nd request to http://www.foo.com/page1?action=doSomethingStateful. That request carries JSESSIONID=$Page2 (and not $Page1 - because cookie value was overwritten) when foo.com receives this request it looks up the wrong HttpSession instance (because JSESSIONID key is $Page2 and NOT $Page1). Foobar! Can the above happen? I think so, but would appreciate a confirmation. If the above is clearly possible, what are some solutions given that we'd like to support multiple iframes per page? We don't have a firm need for the iframes to share the same HttpSession, though that would be nice. In the event that the solution will still stipulate a separate HttpSession per iframe, it is - of course - mandatory that iframe 1 does not end up referencing httpSession state for iframe 2 instead of own. off top of my head I can think of: map page1 and page2 to different domains (ops overhead) use URL rewriting and never cookies (messes up analytics) anything else? thanks a lot, -nikita

    Read the article

  • What are the best patterns/designs for stateful API development?

    - by Svante
    I am about to implement a API for my TCP/IP server written in Java. Right now I have a temporary method that takes a String, executes a command based on the String and returns a String basically like the following. public void communicate(BufferedReader in, PrintWriter out) { while(true) { out.println(handleCommand(in.readLine())); } } private String handleCommand(String command) { if (command.equals("command1") { // do stuff return "Command 1 executed"; } else if (command.equals("command2") { // do some other stuff return "Command 2 executed"; } } I really want to do something more extensible, smarter and stateful, so I could handle more complex and stateful commands and without the method/class getting bloated. How would you start? Suggestions, ideas, or links for further reading are very welcome.

    Read the article

  • Stateful beans and Stateless beans in Spring context

    - by umesh awasthi
    Hi All, i am reading spring through its official documentation and at one place i came to a line that use prototype scope for for all statefull beans while singleton for stateless beans. i know there is something as statefull as well stateless beans in EJB but this is not what they have mentioned in the documents. Can any one explain me what exact this means of statefull as well stateless beans in Spring Thanks in advance

    Read the article

  • Java: InitialContext.lookup(String) - what should the value o the parametr be?

    - by bguiz
    To instantiate a Stateful Session Bean inside of a JSP/ servlet, I am using: InitialContext ic = new InitialContext(); SomeStateful state = (SomeStateful) ic.lookup("java:comp/env/SomeStatefulBean"); Trial and error had me prefix the name of my EJB with java:comp/env/, so the above works (on Glassfish 2.1). However I want to know what the proper way to obtain this prefix is. Is there a CLI tool or function somewhere in the admin panel that will allow we to examine/ alter this? Is this platform/ application server dependant? Is there a setting within my ear, EJB-jar or war which I can examine or alter for this? (Forgive the beginner question) Thanks!

    Read the article

  • Java: Tracking a user login session - Session EJBs vs HTTPSession

    - by bguiz
    If I want to keep track of a conversational state with each client using my web application, which is the better alternative - a Session Bean or a HTTP Session - to use? Using HTTP Session: //request is a variable of the class javax.servlet.http.HttpServletRequest //UserState is a POJO HttpSession session = request.getSession(true); UserState state = (UserState)(session.getAttribute("UserState")); if (state == null) { //create default value .. } String uid = state.getUID(); //now do things with the user id Using Session EJB: In the implementation of ServletContextListener registered as a Web Application Listener in WEB-INF/web.xml: //UserState NOT a POJO this this time, it is //the interface of the UserStateBean Stateful Session EJB @EJB private UserState userStateBean; public void contextInitialized(ServletContextEvent sce) { ServletContext servletContext = sce.getServletContext(); servletContext.setAttribute("UserState", userStateBean); ... In a JSP: public void jspInit() { UserState state = (UserState)(getServletContext().getAttribute("UserState")); ... } Elsewhere in the body of the same JSP: String uid = state.getUID(); //now do things with the user id It seems to me that the they are almost the same, with the main difference being that the UserState instance is being transported in the HttpRequest.HttpSession in the former, and in a ServletContext in the case of the latter. Which of the two methods is more robust, and why?

    Read the article

  • Maintain a variable value between program runs

    - by Akshay J
    I have a simple c# console application that is scheduled after every 5 mins. Every invocation of the program requires the output of the last run. What I am doing right now is using a text file and store the result in it. next time when it runs it opens the text file and know the output of the previous run. Is there any other way to do it that wont require any such text file ? Like maintaining a session variable etc ?

    Read the article

  • How to keep statefull web clients in sync, when multiple clients are looking at the same data?

    - by Hilbrand
    In a RIA web client, created with GWT, the state is maintained in the web client, while the server is (almost) stateless (this is the preferred technique to keep the site scalable). However, if multiple users looking at the same data in their browser and one user changes something, which is send to the server and stored in the database, the other users still have the old data in their browser state. For example a tree is shown and one of the users adds/removes an item from the tree. Since there can be a lot of state in the client, what is the best technique to keep the state in the clients in sync? Are there any java frameworks that take care of this?

    Read the article

  • Business Tier | client state in desktop application- way around Stateful Session Beans?

    - by arthur
    I read positive inputs on the following posts concerning client state management: Stateful EJBs in web application?, here, and here. I want to know how implement such client state management for desktop applications (Swing, AWT, SWT, and other). let's assume there are n desktop clients supposed to use some (remote) services provided on an Application Server. How to maintain a separate and permanent data state for each client , distinct from the other without have to use using stateful session Beans (SFSB) ? is that even possible on this application type ? With Webapp(Servlets / JsSF and JSP) some can avoid using SFSB by HttpSession object and/or coupling it with stateless session beans (SLSB). HttpSession object would keep information for each (Web)client separate and the SLSB would play the business logic music. But HttpSession objects aren't present on desktop application and I go stuck with only SFSB and SLSB. Knowing the problems(Concurrency, Error Handling, usw ) of SFSB, I would have not wanted to use it. What would be the other options? is there only SFSB available? Thanks in advances

    Read the article

1 2 3 4 5  | Next Page >