I've only recently began using components and have completed one that handles security for a web application. As the number of users will be large I've been told to run the component under MTS. A week later and several books digested I've slapped some code into the component, registered it in a package using MTS explorer and when I run the application watched the globe rotate.
My component has NO transactions I'm only interested in the object pooling thing, where old instances of objects are used.
Does this mean my component is running correctly under MTS ?
I find it difficult to understand exactly how I can test this is working, any suggestions ?
Is the below code correct ?
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
mplements MTxAS.ObjectControl
Private mobjContext As MTxAS.ObjectContext
Private Sub Class_Initialize()
#If NOMTS Then
ObjectControl_Activate
#End If
End Sub
Private Sub Class_Terminate()
#If NOMTS Then
ObjectControl_Deactivate
#End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
component code functions here
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub ObjectControl_Activate()
#If NOMTS Then
Set mobjErr = New OEError.CError
#Else
Set mobjContext = GetObjectContext
If Not mobjContext Is Nothing Then
'Initialise transaction as failed. Ensures no accidental commit
If mobjContext.IsInTransaction Then
mobjContext.DisableCommit
End If
End If
#End If
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = True
End Function
Private Sub ObjectControl_Deactivate()
Set mobjErr = Nothing
Set mobjContext = Nothing
End Sub
Apologies for all the questions.
Towser
My component has NO transactions I'm only interested in the object pooling thing, where old instances of objects are used.
Does this mean my component is running correctly under MTS ?
I find it difficult to understand exactly how I can test this is working, any suggestions ?
Is the below code correct ?
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
mplements MTxAS.ObjectControl
Private mobjContext As MTxAS.ObjectContext
Private Sub Class_Initialize()
#If NOMTS Then
ObjectControl_Activate
#End If
End Sub
Private Sub Class_Terminate()
#If NOMTS Then
ObjectControl_Deactivate
#End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
component code functions here
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub ObjectControl_Activate()
#If NOMTS Then
Set mobjErr = New OEError.CError
#Else
Set mobjContext = GetObjectContext
If Not mobjContext Is Nothing Then
'Initialise transaction as failed. Ensures no accidental commit
If mobjContext.IsInTransaction Then
mobjContext.DisableCommit
End If
End If
#End If
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = True
End Function
Private Sub ObjectControl_Deactivate()
Set mobjErr = Nothing
Set mobjContext = Nothing
End Sub
Apologies for all the questions.
Towser