title: Remoting cache object
body: <p>I'm using the following code in a singleton remoting object MBRO. This function is only called on the server side.</p>
  
  <pre><code>''' &lt;summary&gt;
  ''' Return a cached DataCentricObject
  ''' &lt;/summary&gt;
  ''' &lt;created_by&gt;CodingBarfield&lt;/created_by&gt;
  ''' &lt;date&gt;04-08-2011&lt;/date&gt;
  Function DataCentricObjectName(ByVal intID As Integer) As String
      Try
          SyncLock dictDataCentricObject
              If Not dictDataCentricObject.ContainsKey(intID) Then
                  Dim st As struct = dcLoader.LoadRecord(intID)
                  dictDataCentricObject(intID) = st.Descript
              End If
  
              Return dictDataCentricObject(intID)
          End SyncLock
  
      Catch ex As Exception
          Throw New Exception("Error in GetTargName", ex)
      End Try
  End Function
  
  
  Private dictDataCentricObject As New Dictionary(Of Integer, String)
  Dim dcLoader As New DataCentricObject
  </code></pre>
  
  <p>The LoadRecord function simply reads a line from a database table and copies the fields into a little data structure.</p>
  
  <p><strong>The question</strong></p>
  
  <ul>
  <li>Is this code multithreading safe (in a remoting environment)</li>
  <li>Are there any performance benefits for different code</li>
  </ul>