This content has been marked as final. Show 2 replies
I'm not sure if singleton services works with stateless session beans. By other hand, I understand as follow:-
1. After you have created a singleton service class using the SingletonService interface, you must define it as a singleton service within WebLogic Server, see http://download.oracle.com/docs/cd/E1284001/wls/docs103/ConsoleHelp/taskhelp/clusters/ConfigureSingletonService.html_
2. A singleton service is a service (application) on a cluster that is available and active on only one server at any given time, you must deploy the service on only one member of the cluster.
3. For high avalability, you must implement WebLogic Service Migration for your singleton service, see http://download.oracle.com/docs/cd/E1284001/wls/docs103/cluster/service_migration.html#wp1051458_
4. The clients connecting to the service, you must implement a special mechanism. See http://download.oracle.com/docs/cd/E1322201/wls/docs81/jndi/jndi.html#475689_
I cannot get this to work under any scenario. The examples I have found say you need to implement a Remote interface on an implementation of weblogic.cluster.singleton.SingletonService then bind that class under the Remote's name in JNDI during activate, then use JNDI look-up to get back to the singleton but when you look-up in JNDI on any of the servers that don't have the service activated then you get a copy of the service that is not activated and if you change any data it doesn't persist across calls let alone across other servers in the cluster. This whole feature is worthless. If you are going to advertise something as a cluster wide singleton then it should be accessible across the cluster as a single instance object in all cluster jvms and weblogic should handle any replication or whatever in order to keep all servers in the cluster up to date with changes to the singleton's data or whatever.