📄 recd15scr.tcl
字号:
# See the file LICENSE for redistribution information.## Copyright (c) 1996-2002# Sleepycat Software. All rights reserved.## $Id: recd15scr.tcl,v 1.5 2002/01/30 13:18:04 margo Exp $## Recd15 - lots of txns - txn prepare script# Usage: recd15script envcmd dbcmd gidf numtxns# envcmd: command to open env# dbfile: name of database file# gidf: name of global id file# numtxns: number of txns to startsource ./include.tclsource $test_path/test.tclsource $test_path/testutils.tclset usage "recd15script envcmd dbfile gidfile numtxns"# Verify usageif { $argc != 4 } { puts stderr "FAIL:[timestamp] Usage: $usage" exit}# Initialize argumentsset envcmd [ lindex $argv 0 ]set dbfile [ lindex $argv 1 ]set gidfile [ lindex $argv 2 ]set numtxns [ lindex $argv 3 ]set txnmax [expr $numtxns + 5]set dbenv [eval $envcmd]error_check_good envopen [is_valid_env $dbenv] TRUEset usedb 0if { $dbfile != "NULL" } { set usedb 1 set db [berkdb_open -auto_commit -env $dbenv $dbfile] error_check_good dbopen [is_valid_db $db] TRUE}puts "\tRecd015script.a: Begin $numtxns txns"for {set i 0} {$i < $numtxns} {incr i} { set t [$dbenv txn] error_check_good txnbegin($i) [is_valid_txn $t $dbenv] TRUE set txns($i) $t if { $usedb } { set dbc [$db cursor -txn $t] error_check_good cursor($i) [is_valid_cursor $dbc $db] TRUE set curs($i) $dbc }}puts "\tRecd015script.b: Prepare $numtxns txns"set gfd [open $gidfile w+]for {set i 0} {$i < $numtxns} {incr i} { if { $usedb } { set dbc $curs($i) error_check_good dbc_close [$dbc close] 0 } set t $txns($i) set gid [make_gid recd015script:$t] puts $gfd $gid error_check_good txn_prepare:$t [$t prepare $gid] 0}close $gfd## We do not close the db or env, but exit with the txns outstanding.#puts "\tRecd015script completed successfully"flush stdout
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -