Results 1 to 2 of 2

Thread: Thread safety

  1. #1
    Join Date
    Mar 2008
    Posts
    108

    Default Thread safety

    The documentation in SingleConnectionFactory (super class for CachingConnectionFactory) states:


    /// A ConnectionFactory adapter that returns the same Connection
    /// from all CreateConnection() calls, and ignores calls to
    /// Connection.Close(). According to the JMS Connection
    /// model, this is perfectly thread-safe.

    While this is true for JMS connections, it does not appear to be true for ActiveMQ connections:

    ActiveMQ.Connection in NMS API


    Thread Safety

    Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

    Does this mean I should mark the CachingConnectionFactory object as singleton=false in my configuration so that every class who needs a reference gets a unique instance?

  2. #2
    Join Date
    Mar 2008
    Posts
    108

    Default

    It looks like this will be fixed in NMS version 1.1

    https://issues.apache.org/activemq/browse/AMQNET-112

Posting Permissions

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