Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I really do hate that NotesSession COM object.</p> <p>You cannot use it in another thread than the thread it was initialized. Threads in .NET are fibers, the real underlying thread may change at any time.</p> <p>So I suggest using it this way, in a <em>using</em> block :</p> <pre><code>Imports Domino Imports System.Threading Public Class AffinitedSession Implements IDisposable Private _session As NotesSession Public Sub New(ByVal pass As String) Thread.BeginThreadAffinity() _session = New NotesSession() _session.Initialize(pass) End Sub Public ReadOnly Property NotesSession() As NotesSession Get Return _session End Get End Property Private disposedValue As Boolean = False ' To detect redundant calls ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not Me.disposedValue Then If disposing Then ' TODO: free other state (managed objects). End If ' TODO: free your own state (unmanaged objects). ' TODO: set large fields to null. _session = Nothing Thread.EndThreadAffinity() End If Me.disposedValue = True End Sub #Region " IDisposable Support " ' This code added by Visual Basic to correctly implement the disposable pattern. Public Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub #End Region End Class </code></pre> <p>Notice the Thread.BeginThreadAffinity() and the Thread.EndThreadAffinity()</p> <p>Those are your friends.</p> <p>Cheers !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload