Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

How many instances will create

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Every body,
In EJB how to create the instances. How many instances will create for application. Suppose if 10 users will access any bean it will create 10 instances or one instance(I think one instance means it will come single ton. EJB not supporting single ton extensively) for any bean like Session or Entity beans.

Advancedly Thanks,
Sanju.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanju,


HI Every body,
In EJB how to create the instances. How many instances will create for application. Suppose if 10 users will access any bean it will create 10 instances or one instance


Usually developers do not control the way bean instances are created into the pool. All they can do is to define the initial number and the maximum number of bean instances in the pool. The container will create more and more instances as needed up to the specified maximum value; all incoming client requests will block after that waiting for instances to become available. If the transaction timeout is exceeded the container will throw an exception.


I think one instance means it will come single ton. EJB not supporting single ton extensively)


You right singleton are not supported. However there is a work around: define the initial number of instances = max number of instances = 1. This way you�ll have exactly one bean instance (kind of singleton). However this paradigm will brake in a clustered environment.
Regards.
 
Sanju
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Valentin Tanase ,
first Thank you for your valid information.

I have one doubt again,Is it possible to declare instances in server level? if not, who will declare , it is based on server vendor or ? do you have any idea abt what is the min and max instances declaration for any server or (how many for weblogic,Jboss).
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don�t specify any values for the initial-beans-in-free-pool or max-beans-in-free-pool configuration parameters, then the container will use some default values. WebLogic for example will default the first parameter to 0 and the second to 1000 for entity ejbs. The rule is little bit more complicated for SLSB. The first parameter still defaults to 0, but the second one depends upon the available memory and the number of execute threads.
Regards.
 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far i know it really costly and troubling giving if u use Singleton Dsgn Pattern....it is almost like creating a servlet which extends Single thread Model...

coming to Num of instsnces...

in Weblogic we have option for creating instances for both Max ...when used with struts frameworm u make use of plugin so that as soon as ur app is UP it will create instance it sis some thing like u r creating ur own Pool manager..

we have a provision for max instances... so if instances exceeds web app wich will poll the instances (actiovation / p assivvation)....

g r gowtham
grgowtham_cse@yahoo.com
gowtham@capricornsys-global.com....
 
What a show! What atmosphere! What fun! What a tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic