Results 1 to 3 of 3

Thread: Does Spring handle stale JNDI destinations?

  1. #1
    Join Date
    Feb 2010
    Posts
    20

    Default Does Spring handle stale JNDI destinations?

    Hi,

    Reading the WebLogic documentation http://download.oracle.com/docs/cd/E...html#wp1311973 it states:

    ..some JMS providers, like WebLogic JMS, may invalidate a Destination object after a server failure. So, if the EJB runs on Server A, and JMS runs on Server B, then the EJB on Server A will have to perform the JNDI lookup of the objects from Server B again after that server has recovered.


    So if I am using Spring to load all my JNDI objects at context startup, will it handle doing to re-lookups automatically if my JMS Provider does invalidate the Destination object?

    Thanks for any help,

    Mandy

  2. #2
    Join Date
    Oct 2007
    Location
    London, England
    Posts
    108

    Default

    JndiDestinationResolver has a setCache method which defaults to true and also implements the CachingDestinationResolver interface which allows removal of specific items from the cache or the clearing of the cache. Set caching to false will cause some performance overhead so you may want check how much of a performance overhead that causes before considering that as an option.

    A better solution would be to detect the exception indicating that the destination is no longer valid and remove that particular destination from the cache.

    Jonas
    Jonas Partner
    OpenCredo

  3. #3
    Join Date
    Feb 2010
    Posts
    20

    Default

    Thanks for the reply Jonas, pls could you explain how I can detect the exception? Also, to remove the destination from the cache do I just get hold of the JndiDestinationResolver bean from the application context and call removeFromCache()? If so, is the param to removeFromCache() the bean name of the destination or the jndi lookup name?

    Thanks

    Mandy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •