Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

singleton EJB?  RSS feed

 
Ayub ali khan
Ranch Hand
Posts: 395
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I appreciate if any one could clarify my doubts.

1) What does one means when they say develop singleton EJB?

Is it possible to write a singleton EJB.

2) We have a requirement where the was scheduler need to query the database to get the most current record from table ABC.

What is a good design practice to implementing the logic to query the table.

Our current approach is to use the EJB which will query the tabel and return the result. our concern is that the scheduler will have to lookup the EJB every 5 seconds and then query the DB.

Appreciate all the inputs on these.

Thank you.

Ayub
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ayub ali khan:

1) What does one means when they say develop singleton EJB?


Ask them

The number of (stateless session and message-driven) bean instances is managed by the server, and normally, Java EE allows the developer to implement the required functions without interfering with this responsibility of the server;
if needed, the administrator may set server-specific parameters to control the bean pool size.
[ January 04, 2007: Message edited by: Edvins Reisons ]
 
Ayub ali khan
Ranch Hand
Posts: 395
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ed,

Thanks for your comments. Let me refrase my question, can we implement a Singleton EJB. I searched in google and found one discussion who mentioned that if the bean pool size is set to one then it would be a singleton. Also any ideas to my second question in my initial post?

Best Regards
Ayub
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ayub ali khan:

can we implement a Singleton EJB. I searched in google and found one discussion who mentioned that if the bean pool size is set to one then it would be a singleton.


Apparently yes, I just wonder what for...

Also any ideas to my second question in my initial post?

which merits a separate thread
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually there are times when you want the EJB to run in only one node on your cluster, and for instance, in JBoss, in the cluster configuration there is a deploy-singleton directory where you can drop your deployments and it will only be running on one node, but still have failover. JMS is already in that directory.

Mark
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!