of_begintran


pfcapsrv.pbl   >   pfc_n_cst_luw   >   of_begintran   

Full name pfc_n_cst_luw.of_begintran
Access public
Extend of integer
Return value integer
Prototype public function integer of_begintran(n_tr[])

Name Datatype
No Data

Name Datatype
li_i Integer
li_idx Integer
li_max Integer
li_maxundo Integer
li_rc Integer
ls_name string

public function integer of_begintran (n_tr atr_control[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  
//	of_BeginTran
//
//	Access:  Public
//
//	Arguments:
//	atr_control[]   Array of controls to Begin Transactions on.
//
//	Returns:  integer
//	 1 = no error found
//	-1 = error
//
//	Description:
//	Begin Transaction(s) on all the Transaction Objects.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
//	6.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 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_max
Integer	li_maxundo
Integer	li_idx
Integer 	li_i
Integer	li_rc
string	ls_name

// Validate the argument.
If IsNull(atr_control) Then
	Return -1
End If

// If requested use the assist funtionality.
If ib_assist Then 
	of_Assist(is_instancename+'.of_BeginTran('+of_GetClassNames(atr_control)+')')
End If

// Loop around all transactions objects, Begining a new Transaction on each.
li_max = UpperBound(atr_control)
For li_i = 1 to li_max
	If atr_control[li_i].of_Begin() < 0 Then
		// -- An error begining a transaction has been encountered. --
		
		// RollBack the transactions that were just started.
		li_maxundo = li_i - 1
		For li_idx = 1 to li_maxundo
			li_rc = atr_control[li_idx].of_Rollback()				
		Next					
		
		// If requested use the assist funtionality.
		If ib_assist Then
			ls_name = atr_control[li_i].of_GetName()
			If Len(ls_name) = 0 Then ls_name = atr_control[li_i].Classname()
			of_assist(is_instancename+'.of_BeginTran() failed with '+ls_name+' of_Begin()')
		End If		
		Return -1
	End If
Next

// If requested use the assist funtionality.
If ib_assist Then
	of_assist(is_instancename+'.of_BeginTran() successfully executed of_Begin()(s).')
End If

Return 1
end function

     
Name Owner
pfc_n_cst_luw.of_save pfc_n_cst_luw

     
Name Owner
powerobject.classname powerobject
systemfunctions.isnull systemfunctions
systemfunctions.len systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_luw.of_getclassnames pfc_n_cst_luw
pfc_n_cst_luw.of_assist pfc_n_cst_luw
pfc_n_tr.of_RollBack pfc_n_tr
pfc_n_tr.of_GetName pfc_n_tr
pfc_n_tr.of_begin pfc_n_tr

     
Full name
No Data

     
Name Scope
No Data