db_last_used_handle (private)

 db_last_used_handle [ -dbn dbn ]

Defined in packages/acs-tcl/tcl/01-database-procs.tcl

Get the last used inactive handle.

Switches:
-dbn (optional)
database name
Returns:
last active handle or empty string

Partial Call Graph (max 5 caller/called nodes):
%3 db_resultrows db_resultrows (public) db_last_used_handle db_last_used_handle db_resultrows->db_last_used_handle db_available_pools db_available_pools (public) db_last_used_handle->db_available_pools

Testcases:
No testcase defined.
Source code:
        set pools [db_available_pools $dbn]
        set currentHandles [ns_db currenthandles]

        set last_used_handle ""
        foreach pool $pools {
            if {[dict exists $currentHandles $pool]} {
                foreach {handle active} [dict get $currentHandles $pool] {
                    #ns_log notice "### FOUND pool $pool handle $handle active $active"
                    if {$active eq 0} {
                        set last_used_handle $handle
                    }
                }
            }
        }
        #ns_log notice "###### db_last_used_handle: <$currentHandles> last used $last_used_handle"
        return $last_used_handle
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: