|
of_destroy
|
|
Full name
|
pfc_n_cst_trregistration.of_destroy
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_destroy()
|
Name
|
Datatype
|
li_destroycnt
|
integer
|
li_idx
|
integer
|
li_upper
|
integer
|
ltr_object
|
n_tr
|
public function integer of_destroy ();//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Destroy
//
// Access: public
//
// Arguments: None
//
// Returns: integer
// The number of transactions destroyed. -1 in case of error.
//
// Description:
// Destroy all registered transaction objects.
//
// Note:
// Performing a destroy on a registed object also has the effect of
// unregistering it.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0.01 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
integer li_destroycnt
integer li_idx
integer li_upper
n_tr ltr_object
// Loop around all transaction slots.
li_upper = UpperBound (inv_trans)
For li_idx = 1 To li_upper
If IsValid (inv_trans[li_idx].tr_object) then
If Not of_IsAllowSQLCADestroy() Then
If IsValid(SQLCA) Then
If inv_trans[li_idx].tr_object = SQLCA Then
// Service has been asked not to delete the Gloval SQLCA.
Continue
End If
End If
End If
// Unregister the transaction; Destroy the transaction.
ltr_object = inv_trans[li_idx].tr_object
of_Unregister(ltr_object)
Destroy ltr_object
li_destroycnt ++
End If
Next
Return li_destroycnt
end function