project BLF > class ComponentPool > method StartPersistenceInPool

Description

Returns a handle to the persistence layer component and runs it on first time.


Parameters


ihClassinputhandle
ohPersistenceoutputhandle
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method ComponentPool.Main


program code (program1/componentpool.p)

assign oiReturnStatus = -98.

if not valid-handle(vhPersistenceInPool)
or vhPersistenceInPool:unique-id <> viPersistenceUID
then do:
    <M-1 run MainBlock
       (input  ihClass (ihClass), 
        input  '' (icDBMS), 
        output viFcReturnSuper (oiReturnStatus)) in Progress>
    if viFcReturnSuper <> 0
    then assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then do:
        run gipr_DeleteProcedure in vhFcComponent.
        delete procedure vhFcComponent.
        return.
    end.
    
    assign vhPersistenceInPool = vhFcComponent
           viPersistenceUID    = vhFcComponent:unique-id.
end.

assign ohPersistence = vhPersistenceInPool.

if oiReturnStatus = -98
then oiReturnStatus = 0.