• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to share temporary, continuously changing data between clients

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all developers,

I need some advice here please, I will try to explain as best I can and be as short as possible:

[How to share temporary, continuously changing data between clients in EJB's]

I need to create a "File server" that collects data on demand from an external URL, each service will fetch live data, and deliver the data to clients.

Each "server instance" will be responsible for collecting live data, and the amount of "server instances" will be one per resource file.
The reason for this is to minimize the network traffic to the external URL's.

External URL File 1--------------------------> [ server instance 1] ---------------------->[ serving clients one two and three]

External URL File 2--------------------------> [ server instance 2]----------------------->[ serving clients four and five]

External URL File 3--------------------------> [ server instance 3]----------------------->[ serving clients 6 to 1000]


I guess the server can not be a servlet, since each request/client gets a new instance;
I am not sure if EJB's behave the same ... I presume the same.

I have searched on "Singletons" but seems that might be problematic too... and server specific, seems Glassfish does offer a singleton EJB.

Any advice please.... What can one use EJB/SERVLETS/etc.








 
Ranch Hand
Posts: 247
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stateless Session Bean would do good since on demand data is fetched for each client...

And Servlet can be used with the avoidance of creation of instance variable in servlet class which will be accessible to multiple threads...

On the whole, Servlet as client to Stateless Session bean can be tried...
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm sorry i could not get your requirements correct ......

wayne forrest wrote:
I guess the server can not be a servlet, since each request/client gets a new instance;
I am not sure if EJB's behave the same ... I presume the same.




for every request we would be having new Thread, not Servlet new instance...
Servlet specification suppots shared memory concepts through ServletContext /PageContext ....
 
reply
    Bookmark Topic Watch Topic
  • New Topic