• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

singleton java object in weblogic cluster

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My application requires only one object through out several managed servers in a weblogic cluster. WE tried putting RMI object in weblogic JNDI. We are facing several issues.

1) If we select the clusterable option then we find that different instance is created on each managed server.
2) if we do not give the clusterable option then we can retrive the object on theserver which initially bound the object into weblogic jndi. But we get ClassCastException on all the other managed servers.

I have read many threads which also suggest that singleton i J2EE cluster is not possible.
Please suggest/help.

Thanks,
Ashutosh Kaur
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://e-docs.bea.com/wls/docs81/jndi/jndi.html#475689
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Justin pointed out it certainly is possible. However, in my mind you're toatally messing up two of the huge benefits to a cluster - failover and load balancing. If the managed node your singleton exists on goes down, what do the consumers of that service do? If that service becomes very busy what is the point of having a cluster - everybody will be waiting on this singleton.

Just my $0.02 worth.
 
Ashutosh kaur
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Justin/Scott,
Thanks for replying.

Load balanging: My this application is runing at the back ground. Users are not aware of such an application. So the users wont have to wait if the service is too busy.

Fail over: Yes I need to handle this. I am using an RMI object. I have gone through the link sent by Justing already. It says that if we use RMI objects, weblogic handles the fail over:

from the link..
--------------------------------------------------
To make J2EE services available to a client, WebLogic binds an RMI stub for a particular service into its JNDI tree under a particular name. The RMI stub is updated with the location of other instances of the RMI object as the instances are deployed to other servers in the cluster. If a server within the cluster fails, the RMI stubs in the other server's JNDI tree are updated to reflect the server failure.
--------------------------------------------------

I have multiple servers running in a cluster and a single database. There are threads running and I want to process the rows from one table. I have to read the entries in this table and do some java prosessing which includes making JMS calls, using EJB and updating some more tables. My problem is that even after using exclusive locking mechanism through EJB, threads from multiple managed servers are able to read the same record. I want to avoid this. Thats why I need to have only single object through out the application.


by using narrowing now, I do not get class case exception. But fail over is still important to me. The link says that i can bind an rmi object on one of the managed servers and the fail over wil be handled automatically.

Please share your thoughts.
 
Run away! Run away! Here, take this tiny ad with you:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic