view release on metacpan or search on metacpan
SecretBuffer.xs view on Meta::CPAN
#else /* POSIX */
pthread_detach(result->threadHandle); /* Parent continues without waiting for child */
#endif
}
ASYNC_RESULT_MUTEX_UNLOCK(result);
/* can't destroy mutexes while locked */
if (destroy) {
#ifdef WIN32
DeleteCriticalSection(&result->cs);
CloseHandle(result->startEvent);
CloseHandle(result->readyEvent);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Sodium/XS/MemVault.pm view on Meta::CPAN
my $extracted_data_mv = $mv->extract(1, 3); # "ell"
print $extracted_data_mv->unlock, "\n";
undef $extracted_data_mv;
$mv->unlock;
my $mv2 = $mv->clone; # unlocked clone is unlocked
$mv2->xor_equals("\x{1f}\x{0a}\x{1e}\x{00}\x{0b}");
print "$mv, $mv2!\n";
my $colon_idx = $mv->index('ll'); # 2
my $unlocked_mv = $mv->clone;
$mv->lock;
=head1 DESCRIPTION
L<Crypt::Sodium::XS::MemVault> is the container for protected memory objects in
lib/Crypt/Sodium/XS/MemVault.pm view on Meta::CPAN
C<$size> is optional iif C<$mv> and C<$other_mv> (or C<$bytes>) are equal
sizes. If provided, only C<$size> bytes are compared. B<Note>: Croaks if a
comparison is of unequal sizes and C<$size> was not provided, or if C<$size> is
larger than either of the operands.
Croaks if C<$mv> or C<$other_mv> is conceptually "locked". See L</lock> and
L</unlock>.
B<Note>: This method is similar to L<memcmp(3)>; that is, it returns -1, 0, or
1 for the comparison results. For simple true/false equality comparisons, see
L</memcmp>. The naming is chosen here to be consistent with libsodium.
lib/Crypt/Sodium/XS/MemVault.pm view on Meta::CPAN
protected memory.
This method should only be used when protected memory starts with non-sensitive
data, and is guaranteed to find C<$substr> before any sensitive data.
Croaks if C<$mv> is conceptually "locked". See L</lock> and L</unlock>.
The C<Crypt::Sodium::XS::MemVault> object must be unlocked (L</unlock>) before
using this method.
=head2 is_locked
my $is_locked = $mv->is_locked;
Returns a boolean indicating if the object is conceptually "locked."
=head2 is_zero
my $is_null = $mv->is_zero;
lib/Crypt/Sodium/XS/MemVault.pm view on Meta::CPAN
my $bytes = $mv->to_bytes;
Returns the protected memory as a byte string. This is the method used to
overload stringification. Consider carefully before using.
Croaks if C<$mv> is conceptually "locked". See L</lock> and L</unlock>.
=head2 to_hex
my $new_mv = $mv->to_hex;
lib/Crypt/Sodium/XS/MemVault.pm view on Meta::CPAN
All comparisons treat their operands as arbitrary-length little-endian
integers. Comparisons are made in fixed-type (for a given size), but the
results can leak information about protected memory. See L</compare>.
Croaks if C<$mv> or C<$other_mv> is conceptually "locked". See L</lock> and
L</unlock>.
=head2 stringification
my $var = "$mv";
Equivalent to L</to_bytes>. Stringification will croak if the
L<Crypt::Sodium::XS::MemVault> is conceptually "locked". See L</lock> and
L</unlock>. See also L</to_bytes>.
=head2 concatenation
my $new_mv = $mv . $string;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/XkcdPassword/Words/EN.pm view on Meta::CPAN
dropped
butt
credit
obvious
cry
locked
larry
loving
positive
nuts
agreed
lib/Crypt/XkcdPassword/Words/EN.pm view on Meta::CPAN
correctly
complaint
chickens
charlotte
caitlin
blocked
trophy
tortured
structure
rot
risking
view all matches for this distribution
view release on metacpan or search on metacpan
get_av|5.006000|5.003007|p
getc|5.003007||Viu
get_c_backtrace|5.021001||Vi
get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
PERL_MALLOC_WRAP|5.009002|5.009002|Vn
PerlMem_calloc|5.006000||Viu
PerlMem_free|5.005000||Viu
PerlMem_free_lock|5.006000||Viu
PerlMem_get_lock|5.006000||Viu
PerlMem_is_locked|5.006000||Viu
PerlMem_malloc|5.005000||Viu
PERL_MEMORY_DEBUG_HEADER_SIZE|5.019009||Viu
PerlMemParse_calloc|5.006000||Viu
PerlMemParse_free|5.006000||Viu
PerlMemParse_free_lock|5.006000||Viu
PerlMemParse_get_lock|5.006000||Viu
PerlMemParse_is_locked|5.006000||Viu
PerlMemParse_malloc|5.006000||Viu
PerlMemParse_realloc|5.006000||Viu
PerlMem_realloc|5.005000||Viu
PerlMemShared_calloc|5.006000||Viu
PerlMemShared_free|5.006000||Viu
PerlMemShared_free_lock|5.006000||Viu
PerlMemShared_get_lock|5.006000||Viu
PerlMemShared_is_locked|5.006000||Viu
PerlMemShared_malloc|5.006000||Viu
PerlMemShared_realloc|5.006000||Viu
PERL_MG_UFUNC|5.007001||Viu
Perl_modf|5.006000|5.006000|n
PERL_MULTICONCAT_HEADER_SIZE|5.027006||Viu
putc|5.003007||Viu
put_charclass_bitmap_innards|5.021004||Viu
put_charclass_bitmap_innards_common|5.023008||Viu
put_charclass_bitmap_innards_invlist|5.023008||Viu
put_code_point|5.021004||Viu
putc_unlocked|5.003007||Viu
putenv|5.005000||Viu
put_range|5.019009||Viu
putw|5.003007||Viu
pv_display|5.006000|5.003007|p
pv_escape|5.009004|5.003007|p
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypto/Exchange/Binance/Spot/API.pm view on Meta::CPAN
response => {
key => 'balances',
row => {
coin => 'asset',
available => 'free',
in_order => 'locked',
},
row_filter => sub {
my ($self, $row) = @_;
if ($row->{available} == 0 && $row->{in_order} == 0) {
return 'next';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypto/NanoRPC.pm view on Meta::CPAN
wallet_frontiers => [ 'wallet' ],
wallet_history => [ 'wallet', [ 'modified_since' ] ],
wallet_info => [ 'wallet' ],
wallet_ledger => [ 'wallet', [ 'representative', 'weight', 'pending', 'modified_since' ] ],
wallet_lock => [ 'wallet' ],
wallet_locked => [ 'wallet' ],
wallet_pending => [ 'wallet', 'count', [ 'threshold', 'source', 'include_active', 'include_only_confirmed' ] ],
wallet_representative => [ 'wallet' ],
wallet_representative_set => [ 'wallet', 'representative', [ 'update_existing_accounts' ] ],
wallet_republish => [ 'wallet', 'count' ],
wallet_work_get => [ 'wallet' ],
lib/Crypto/NanoRPC.pm view on Meta::CPAN
account_balance account_block_count account_get account_history account_info account_key account_representative account_weight accounts_balances accounts_frontiers accounts_pending active_difficulty available_supply block_account block_count block_co...
=head2 Wallet RPCs
account_create account_list account_move account_remove account_representative_set accounts_create password_change password_enter password_valid receive receive_minimum receive_minimum_set search_pending search_pending_all send wallet_add wallet_add_...
=head2 Unit Conversion RPCs
krai_from_raw krai_to_raw mrai_from_raw mrai_to_raw rai_from_raw rai_to_raw
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CtrlO/Crypt/XkcdPassword/Wordlist/eff_large.pm view on Meta::CPAN
unlisted
unlit
unlivable
unloaded
unloader
unlocked
unlocking
unlovable
unloved
unlovely
unloving
view all matches for this distribution
view release on metacpan or search on metacpan
bin/pmix/pmix view on Meta::CPAN
h - displays this Help screen
b - toggles Big mode (with all channel options)
S - toggles Stereo mode (for all channels that support it)
m - toggles Muting
o - toggles current channel as Only audible channel
a - toggles locked slider bar across All channels
t - toggles display of Title bar
I - toggles display of soundcard device Info
C - toggles Centering of soundcard device info
s - Save all current channel values to ~/.${name}rc
l - Load ~/.${name}rc into current channel values
view all matches for this distribution
view release on metacpan or search on metacpan
----------------------------
revision 0.1 locked by: corliss;
date: 2002/11/14 19:17:24; author: corliss; state: Exp;
--Initial revision
view all matches for this distribution
view release on metacpan or search on metacpan
----------------------------
revision 1.997 locked by: corliss;
date: 2002/11/14 18:22:59; author: corliss; state: Exp; lines: +124 -6
--Added window management array and functions
--POD updates
--Form windows are now set to syncok
--Subforms now return focus to parent form after last widget
----------------------------
revision 1.996 locked by: corliss;
date: 2002/11/04 01:01:46; author: corliss; state: Exp; lines: +293 -105
--Added subform support
--Reworked slightly for new Curses::Widgets internals
--Removed touchwin calls
--Added ALTFBASE for loading subforms from different namespace
All form descendents:
--Adjusted internal geometry calculations to reflect new API behaviour
----------------------------
revision 1.995 locked by: corliss;
date: 2002/10/22 18:21:36; author: corliss;
--Added support for alternate namespace searching for widgets
--Added form autocenter support for non-derived forms
--Added DONTSWITCH directive to keep focus on the same widget
--Now passing default colours to all the widgets that don't explicitly
view all matches for this distribution
view release on metacpan or search on metacpan
----------------------------
revision 1.997 locked by: corliss;
date: 2002/11/14 01:30:19; author: corliss; state: Exp; lines: +34 -7
--POD fixes
--Compatibility fix for curses without attr_get/attr_set functions
--Introduction of the multi-column list box
ListBox:
--Checking for defined code reference before attempting to execute
TextMemo:
--Changed arrow placement to go by window bounds to make inherited
behaviour more predictable
----------------------------
revision 1.996 locked by: corliss;
date: 2002/11/03 23:25:01; author: corliss; state: Exp; lines: +450 -75
--Added test_colour function
--Added DEFAULTFG and DEFAULTBG scalars
--Removed hard coded black:white colour pair, now detecting
actual colours
--Fixed underline mode to correctly underline entire field, instead
of just text
--Added regex to accept only printable characters as part of the value
--Fixed bugs in cursor placement and scrolling
----------------------------
revision 1.995 locked by: corliss;
date: 2002/10/22 18:00:23; author: corliss;
--Added Menu and Label widgets
--Auto-applying the list length based on list entries was getting lost
at times in the ComboBox. Fixed.
--Popup wouldn't show up in the right location on combos on newwins that
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cyrillic.pm view on Meta::CPAN
=back
=head1 Environment Variable
This software uses the flock function for exclusive control. The execution of the
program is blocked until it becomes possible to read or write the file.
You can have it not block in the flock function by defining environment variable
CHAR_NONBLOCK.
Example:
view all matches for this distribution
view release on metacpan or search on metacpan
# Get/set "closed" flag (when not set produces "*", or "splat" files):
my $is_closed = $item->closed();
$item->closed($is_closed);
# Get/set "locked" flag (when set produces ">" locked files):
my $is_locked = $item->locked();
$item->locked($is_locked);
# Get/set track location of first sector of file:
my $track = $item->track();
$item->track($track);
}
return (ord ($self->[$I_CLOSED]) & 0b10000000) == 0b10000000;
}
=head2 locked
Get "locked" flag:
my $is_locked = $item->locked();
Returns true when "locked" flag is set, and false otherwise.
Set "locked" flag:
$item->locked($is_locked);
When "locked" flag is set, it produces ">" locked files.
=cut
sub locked {
my ($self, $is_locked) = @_;
if (defined $is_locked) {
if (ref $is_locked) {
die q{Invalid "locked" flag};
}
my $locked_bit = $is_locked ? 0b01000000 : 0b00000000;
$self->[$I_LOCKED] = chr ((ord ($self->[$I_LOCKED]) & 0b10111111) | $locked_bit);
}
return (ord ($self->[$I_LOCKED]) & 0b01000000) == 0b01000000;
}
my $stdout = select $fh;
if ($as_petscii) {
my $type = $self->type_to_string($self->type(), 1);
my $closed = $self->closed() ? 0x20 : 0x2a; # "*"
my $locked = $self->locked() ? 0x3c : 0x20; # "<"
my $track = sprintf "%2d", $self->track();
my $sector = sprintf "%2d", $self->sector();
my $size = ascii_to_petscii($self->size());
my $name = sprintf "\"%s\"", $self->name(padding_with_a0 => 0);
$name =~ s/\x00//g; # align file type string to the right column
if ($verbose) {
printf "%-4d %-18s%c%s%c %s %s\n", $size, $name, $closed, $type, $locked, $track, $sector;
}
else {
printf "%-4d %-18s%c%s%c\n", $size, $name, $closed, $type, $locked;
}
}
else {
my $type = $self->type_to_string($self->type());
my $closed = $self->closed() ? ord ' ' : ord '*';
my $locked = $self->locked() ? ord '<' : ord ' ';
my $track = sprintf "%2d", petscii_to_ascii $self->track();
my $sector = sprintf "%2d", petscii_to_ascii $self->sector();
my $size = $self->size();
my $name = sprintf "\"%s\"", petscii_to_ascii($self->name(padding_with_a0 => 0));
$name =~ s/\x00//g; # align file type string to the right column
if ($verbose) {
printf "%-4d %-18s%c%s%c %s %s\n", $size, $name, $closed, $type, $locked, $track, $sector;
}
else {
printf "%-4d %-18s%c%s%c\n", $size, $name, $closed, $type, $locked;
}
}
select $stdout;
my $closed = $self->closed();
die unless defined $closed;
$test->closed($closed);
my $locked = $self->locked();
die unless defined $locked;
$test->locked($locked);
my $track = $self->track();
die unless defined $track;
$test->track($track);
view all matches for this distribution
view release on metacpan or search on metacpan
Dir/Entry.pm view on Meta::CPAN
my $file_type = ord (substr $bytes, 0x00, 0x01);
# Get the actual filetype:
my $type = $file_type & 7;
# Get closed flag (not set produces "*", or "splat" files):
my $closed = $file_type & 0x80;
# Get locked flag (set produces ">" locked files):
my $locked = $file_type & 0x40;
# Get track/sector location of first sector of file:
my $track = ord (substr $bytes, 0x01, 0x01);
my $sector = ord (substr $bytes, 0x02, 0x01);
# Get 16 character filename (in PETASCII, padded with $A0):
my $rawname = substr $bytes, 0x03, 0x10;
Dir/Entry.pm view on Meta::CPAN
my $size = ord (substr $bytes, 0x1D, 0x01) << 8 | ord (substr $bytes, 0x1C, 0x01);
# Store directory entry details in a hash:
my $dirEntry = {
'TYPE' => $type,
'CLOSED' => $closed,
'LOCKED' => $locked,
'TRACK' => $track,
'SECTOR' => $sector,
'NAME' => $name,
'SIDE_TRACK' => $side_track,
'SIDE_SECTOR' => $side_sector,
Dir/Entry.pm view on Meta::CPAN
my @bytes = ();
# Get detailed file information stored within this object instance:
my $dirEntry = $self->{'DETAILS'};
my $type = $dirEntry->{'TYPE'};
my $closed = $dirEntry->{'CLOSED'};
my $locked = $dirEntry->{'LOCKED'};
my $track = $dirEntry->{'TRACK'};
my $sector = $dirEntry->{'SECTOR'};
my $name = $dirEntry->{'NAME'};
my $side_track = $dirEntry->{'SIDE_TRACK'} || 0x00;
my $side_sector = $dirEntry->{'SIDE_SECTOR'} || 0x00;
my $record_length = $dirEntry->{'RECORD_LENGTH'} || 0x00;
my $size = $dirEntry->{'SIZE'};
# Byte $00 - File type:
$bytes[0x00] = chr ($type | ($locked ? 0x40 : 0x00) | ($closed ? 0x80 : 0x00));
# Byte $01 - Track location of first sector of file:
$bytes[0x01] = chr ($track);
# Byte $02 - Sector location of first sector of file:
$bytes[0x02] = chr ($sector);
# Bytes $03..$12 - 16 character filename (in PETASCII, padded with $A0):
Dir/Entry.pm view on Meta::CPAN
croak "An illegal closed flag: ${closed}" unless $closed == 0 || $closed == 1;
$self->{'DETAILS'}->{'CLOSED'} = $closed;
return $closed;
}
=head2 get_locked
Get "Locked" flag (when set produces ">" locked files):
my $locked = $entryObj->get_locked();
Returns true when "Locked" flag is set, and false otherwise.
=cut
sub get_locked {
my $self = shift;
my $locked = $self->{'DETAILS'}->{'LOCKED'};
return $locked ? 1 : 0;
}
=head2 get_track
Get track location of first sector of file:
Dir/Entry.pm view on Meta::CPAN
$args = {} unless defined $args;
my $verbose = $args->{verbose};
# Get detailed file information stored within this object instance:
my $type = $self->get_type();
my $closed = $self->get_closed() ? ord ' ' : ord '*';
my $locked = $self->get_locked() ? ord '<' : ord ' ';
my $size = $self->get_size();
my $track = sprintf '%2d', $self->get_track();
my $sector = sprintf '%2d', $self->get_sector();
# Get filename convert to ASCII and add quotes:
my $name = $self->get_name(1);
my $quotename = sprintf "\"%s\"", $name;
# Print directory entry:
if ($verbose) {
printf $fh "%-4d %-18s%c%s%c %s %s\n", $size, $quotename, $closed, $type, $locked, $track, $sector;
}
else {
printf $fh "%-4d %-18s%c%s%c\n", $size, $quotename, $closed, $type, $locked;
}
}
=head1 BUGS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/D64/Disk/Image.pm view on Meta::CPAN
my $rawname = substr $buffer, $offset + 5;
my $name = $d64->name_from_rawname($rawname);
my $type = $file_type & 7;
my $closed = $file_type & 0x80;
my $locked = $file_type & 0x40;
my $size = ord (substr $buffer, $offset + 31, 1) << 8 | ord (substr $buffer, $offset + 30, 1);
# Convert to ASCII and add quotes:
$name = $d64->petscii_to_ascii($name);
my $quotename = sprintf "\"%s\"", $name;
# Print directory entry:
printf "%-4d %-18s%c%s%c\n", $size, $quotename, $closed ? ord ' ' : ord '*', $file_types[$type], $locked ? ord '<' : ord ' ';
}
}
}
# Print number of blocks free:
view all matches for this distribution
view release on metacpan or search on metacpan
=head2 $db->release;
=head2 ag_db_release($db);
Unlocks I<current record> if it is locked; I<current record> becomes
undefined.
=head2 $db->seek(key => "key", create => 1, size => $size);
=head2 ag_db_newrec($db, "key", $size);
=head2 $db->drop;
=head2 ag_db_delrec
Deletes I<current record> which must be locked.
=head2 $db->next(lock => 1);
=head2 ag_readnext($db);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DB/Object/Constraint/Check.pm view on Meta::CPAN
=head1 SYNOPSIS
use DB::Object::Constraint::Check;
my $check = DB::Object::Constraint::Check->new(
expr => q{CHECK (status::text ~* '^(active|inactive|locked|pending|protected|removed|suspended)$'::text)},
fields => [qw( status )],
name => 'chk_users_status',
) || die( DB::Object::Constraint::Check->error, "\n" );
=head1 VERSION
view all matches for this distribution
view release on metacpan or search on metacpan
sample/db2_check_lock.pl view on Meta::CPAN
#!/usr/bin/perl5
#
# db2_check_lock - Check for blocked applications, optionally kill
#
# $Id: db2_check_lock.pl,v 145.1 2007/11/20 21:51:24 biersma Exp $
#
use strict;
sample/db2_check_lock.pl view on Meta::CPAN
print "No active databases. Nothing to do.\n";
exit(0);
}
my %agent_ids; # Agent Id -> Appl node
my %blocked_apps; # Agent Id -> Agent Id (blocked -> lock owner)
my $no_long_blocked = 0; # No of jobs blocked for > block time
my $now = time();
foreach my $node ($snap->findNodes('APPL')) {
#print $node->Format(); exit(0);
#
sample/db2_check_lock.pl view on Meta::CPAN
next if (defined $args{D} && lc $args{D} ne lc $db_name);
my $agent_id = $node->findValue('APPL_INFO/AGENT_ID');
$agent_ids{$agent_id} = $node;
my $is_blocked = $node->findValue('LOCKS_WAITING');
next unless ($is_blocked);
my $blocker = $node->findValue('LOCK_WAIT/AGENT_ID_HOLDING_LK');
$blocked_apps{$agent_id} = $blocker;
my $start = $node->findValue('LOCK_WAIT/LOCK_WAIT_START_TIME/SECONDS');
if (($now - $start) > $args{t}) {
$no_long_blocked++;
}
}
if ($args{k}) {
my $agent_id = $args{k};
sample/db2_check_lock.pl view on Meta::CPAN
my $db_name = $appl_node->findValue('APPL_INFO/DB_NAME');
DB2::Admin::->ForceApplications($agent_id);
exit(0);
}
unless ($no_long_blocked) {
print "No applications are blocked for over $args{t} seconds\n";
exit(0);
}
if (0) {
#
# Fake a tree
#
$blocked_apps{4} = 5;
$blocked_apps{5} = 6;
$blocked_apps{6} = 8;
$blocked_apps{7} = 8;
# $blocked_apps{8} = 5; # Deadlock
}
#
# See if we can compute a blocking tree
#
my %lock_owner; # Blocked -> Final lock owner
my %lock_children; # Lock owner -> Child -> 1
BLOCKED:
foreach my $agent_id (keys %blocked_apps) {
my $blocker = $blocked_apps{$agent_id};
my $parent = $blocked_apps{$blocker};
if (defined $parent) {
#print "Have lock hierarchy: $agent_id -> $blocker -> $parent\n";
while (defined $blocked_apps{$parent}) {
if ($parent == $blocker) {
print "Deadlock detected ($agent_id -> $blocker ... $blocker)\n";
next BLOCKED;
}
$parent = $blocked_apps{$parent};
}
$lock_owner{$agent_id} = $parent;
$lock_children{$parent}{$agent_id} = 1;
} else {
$lock_owner{$agent_id} = $blocker;
sample/db2_check_lock.pl view on Meta::CPAN
my ($lock_owner) = @_;
print STDERR "Generate alert for [$lock_owner]\n"
if ($args{d});
my $owner_node = $agent_ids{$lock_owner};
my $no_blocked = keys %{ $lock_children{$lock_owner} };
#
# Alert should look like: Error: Server NYPIBA4 agent id 71 has been
# blocking X applications since Aug 17 2004 2:00AM
#
my $since;
foreach my $blocked (keys %{ $lock_children{$lock_owner} }) {
my $appl_node = $agent_ids{$blocked};
my $start = $appl_node->findValue('LOCK_WAIT/LOCK_WAIT_START_TIME/SECONDS');
#print "Have [$blocked] lock wait start time [$start] [" . localtime($start) . "]\n";
if (! defined $since || $start < $since) {
$since = $start;
}
}
my @time_elems = localtime($since);
sample/db2_check_lock.pl view on Meta::CPAN
$time_elems[5] + 1900,
$time_elems[4] + 1,
$time_elems[3],
$time_elems[2],
$time_elems[1]);
my $alert = "Server $ENV{DB2INSTANCE} agent id $lock_owner has been blocking $no_blocked applications since $display_time";
my $now = localtime(time);
my $dbname = $owner_node->findValue('APPL_INFO/DB_NAME');
$dbname =~ s/\s+$//;
my @descendants = keys %{ $lock_children{$lock_owner} };
my @direct_children;
foreach my $id (@descendants) {
next unless ($blocked_apps{$id} == $lock_owner);
push @direct_children, $id;
}
my %blocked_tables;
my %schema_names;
foreach my $id (@direct_children) {
my $node = $agent_ids{$id};
foreach my $wl ($node->findNodes('LOCK_WAIT')) {
my $schema = $wl->findValue('TABLE_SCHEMA');
$schema =~ s/\s+$//;
$schema_names{$schema} = 1;
my $table = $wl->findValue('TABLE_NAME');
$table =~ s/\s+$//;
$blocked_tables{"$schema.$table"} = 1;
}
}
my $table_list = join(', ', sort keys %blocked_tables);
my $desc = "$ENV{DB2INSTANCE}.$dbname";
my $email = <<_END_HEADER_;
Please be advised that there is blocking in $desc.
sample/db2_check_lock.pl view on Meta::CPAN
$email .= "For an explanation of the status column, go to:\n";
$email .= "http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/admin/r0001162.htm\n";
$email .= "\n";
#
# Show at most 10 blocked processes
#
if (@descendants > 10) {
$email .= "There are " . scalar(@descendants) . " processes being blocked\n";
$email .= "The first 10 blocked processes are listed below\n";
$email .= '#' x 20 . "\n";
$email .= display_agents(@descendants[0..9]);
$email .= "\n";
} else {
$email .= "The following processes are being blocked:\n";
$email .= '#' x 20 . "\n";
$email .= display_agents(@descendants);
$email .= "\n";
}
sample/db2_check_lock.pl view on Meta::CPAN
}
my $hostproc = $values->{'CLIENT_PID'};
my $status = $values->{'APPL_STATUS'};
my $block_start = $appl_node->
findValue('LOCK_WAIT/LOCK_WAIT_START_TIME/SECONDS');
my $time_blocked = (defined $block_start ?
$snap_time - $block_start : 'n/a');
#
# For multi-tier apps, add the TP Monitor information if
# available.
sample/db2_check_lock.pl view on Meta::CPAN
if ($values->{TPMON_CLIENT_APP} =~ /\S/) {
$program .= " (for $values->{TPMON_CLIENT_APP})";
}
$table->row($id, $userid, $cmd, $program, $hostname,
$hostproc, $status, $time_blocked);
}
return $table->render(120);
}
sample/db2_check_lock.pl view on Meta::CPAN
[ -d ]
=head1 DESCRIPTION
This script performs a database instance snapshot to determine
blocking. If any agent process is blocked for over a specified time,
an email is generated with information on the blocking process and its
victims. Optionally, the blocking agent process can be killed. This
script must be run on the database server.
This script first gets an application snapshot with basic locking
information. If the C<-k> parameter is specified, the script verifies
whather the specified agent id still exists and still is holding a
lock. If so, the application is forced.
In the absence of a C<-k> parameter, the script verifies whether any
applications is blocked for over the specified time (taken from the
JobParams table, defaulting to 120 seconds). If not, the script takes
no action.
If there is long blocking, the script find the responsible agent
process by following the lock chain. For each responsible agent, an
view all matches for this distribution
view release on metacpan or search on metacpan
appropriate handle and its dependent handles. For example, you cannot create a connection handle
without creating an environment handle first (which is the connection handle's dependent handle --
got it? :).
Use DtfHdlSetAttribute() to change the value of an attribute. A handle's attributes can only be
modified when the handle is not in locked state. A handle assumes the locked state by creating
dependent handles on it. For example, the creation of a connection handle causes the environment
handle to assume locked state. Additionally, a connection handle assumes locked state when it
undergoes a transition into connected state (a user connects).
S< >I<ATTRIBUTE TYPES>
view all matches for this distribution
view release on metacpan or search on metacpan
{
case SE_NOREC:
dbd_st_finish (sth, imp_sth);
break;
case SE_LOCKEDREC:
set_error (sth, "Fetch: record locked");
break;
default:
set_error(sth, "Fetch: error");
break;
}
view all matches for this distribution
view release on metacpan or search on metacpan
{
case SE_NOREC:
dbd_st_finish (sth, imp_sth);
break;
case SE_LOCKEDREC:
set_error (sth, "Fetch: record locked");
break;
default:
set_error(sth, "Fetch: error");
break;
}
view all matches for this distribution
view release on metacpan or search on metacpan
dbd-illustra.pod view on Meta::CPAN
per-transaction by executing a C<SET TRANSACTION ISOLATION LEVEL x>
statement where I<x> is the name of the isolation level required.
The default locking behavior is for readers to block writers.
Rows returned by a SELECT statement can be locked to prevent them from
being changed
by another transaction, by including "LOCK=EXCLUSIVE" or "LOCK=UPDATE" in the
optimizer hints for a given table:
SELECT * FROM xyz USING(LOCK=UPDATE) WHERE xid = 'abc'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/Informix/Summary.pm view on Meta::CPAN
The default locking behaviour for reading and writing depends on the
isolation level, the way the table was defined, and on whether the
database was created with transactions enabled or not.
Rows returned by a SELECT statement can be locked to prevent them being
changed by another transaction, by appending C<FOR UPDATE> to the select
statement. Optionally, you can specify a column list in parentheses
after the C<FOR UPDATE> clause.
The C<LOCK TABLE table_name IN lock_mode> statement can be used to
apply an explicit lock on a table. The lock mode can be C<SHARED> or
C<EXCLUSIVE>. There are constraints on when tables can be unlocked,
and when locks can be applied. Row/Page locking occurs with cursors
C<FOR UPDATE>. In some types of database, some cursors are implicitly
created C<FOR UPDATE>.
view all matches for this distribution
view release on metacpan or search on metacpan
if (0==strcmp(word, "local")) return DBDPG_TRUE;
if (0==strcmp(word, "localtime")) return DBDPG_TRUE;
if (0==strcmp(word, "localtimestamp")) return DBDPG_TRUE;
if (0==strcmp(word, "location")) return DBDPG_TRUE;
if (0==strcmp(word, "lock")) return DBDPG_TRUE;
if (0==strcmp(word, "locked")) return DBDPG_TRUE;
if (0==strcmp(word, "logged")) return DBDPG_TRUE;
if (0==strcmp(word, "mapping")) return DBDPG_TRUE;
if (0==strcmp(word, "match")) return DBDPG_TRUE;
if (0==strcmp(word, "materialized")) return DBDPG_TRUE;
if (0==strcmp(word, "maxvalue")) return DBDPG_TRUE;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/MVS_FTPSQL.pm view on Meta::CPAN
gets different results each time (nonrepetable read phenomena).
=item Uncommitted Read (UR)
With this isolation levels the transaction (almost) doesn't acquire locks and
doesn't check if the data that is retrieving is locked.
This, at the price of risking reading non committed data,
leads to two main advantages:
=over 2
lib/DBD/MVS_FTPSQL.pm view on Meta::CPAN
as illustrated by the following example:
SELECT * FROM SYSIBM.SYSDUMMY1 WITH UR
When using IBM FTP CS as a medium to submit queries, there are two main limitations
that affect your control over the way the data is locked and
isolated between concurrent processes. These limitations are:
=over 2
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
t/021_DBD_Mock_Session.t view on Meta::CPAN
return 'BAD PASSWORD';
}
# otherwise ...
else {
# we must update the login failures, and lock the account
$dbh->do("UPDATE users SET login_failures = (login_failures + 1), locked = 1 WHERE user_id = $user_id"); return 'USER ACCOUNT LOCKED';
}
}
else {
return 'USERNAME NOT FOUND';
}
t/021_DBD_Mock_Session.t view on Meta::CPAN
{
statement => qr/SELECT user_id, login_failures FROM users WHERE username = \'.*?\'/, #'
results => [[ 'user_id', 'login_failures' ], [ 1, 4 ]]
},
{
statement => sub { $_[0] eq "UPDATE users SET login_failures = (login_failures + 1), locked = 1 WHERE user_id = 1" },
results => []
}
));
isa_ok($lock_user_account, 'DBD::Mock::Session');
is($lock_user_account->name(), 'lock_user_account', '... got the right name');
my $dbh = DBI->connect('dbi:Mock:', '', '');
$dbh->{mock_session} = $lock_user_account;
is(Login::Test::login($dbh, 'user', '****'), 'USER ACCOUNT LOCKED', '... username is found, and the password is wrong, and the user account is now locked');
}
# now check some errors
{
view all matches for this distribution
view release on metacpan or search on metacpan
examples/thrtest.pl view on Meta::CPAN
}
elsif ($action == 1 && !$cursor1)
{
$cursor1 -> finish if ($cursor1) ;
$cursor1 = $dbh->prepare("SELECT userID, authHandler, password
FROM thrtest1 WHERE login = ? and locked IS NULL
ORDER BY password");
die "db error $DBI::errstr" if (!$doerr && $DBI::errstr) ;
}
elsif ($action == 2 && !$cursor2)
{
examples/thrtest.pl view on Meta::CPAN
}
elsif ($action == 4 && $cursor1 && $login)
{
#$cursor1 -> finish if ($cursor1) ;
#$cursor1 = $dbh->prepare("SELECT userID, authHandler, password
# FROM thrtest1 WHERE login = ? and locked IS NULL
# ORDER BY password");
#
$cursor1->execute($login) ;
$cursor1->bind_columns(\($userID, $authHandler, $passwd));
$cursor1->fetch;
examples/thrtest.pl view on Meta::CPAN
eval {
$dbh -> do ('drop table thrtest1') ;
$dbh -> do ('drop table thrtest2') ;
} ;
my $c = q{ create table thrtest1 (userID varchar(80), authHandler varchar(80), password varchar(80), login varchar(80), lastLogin date, locked int) } ;
$dbh -> do ($c) ;
my $c = q{ create table thrtest2 (handlerID varchar(80), authMode varchar(80), data varchar(80)) } ;
view all matches for this distribution
view release on metacpan or search on metacpan
t/14threads.t view on Meta::CPAN
#trade dbh between threads
my @thr;
my @sem;
use Thread::Semaphore;
# create locked semaphores
for my $i ( 0 .. 2 ) {
push @sem, Thread::Semaphore->new(0);
}
undef $last_session;
view all matches for this distribution
view release on metacpan or search on metacpan
if (0==strcmp(word, "local")) return DBDPG_TRUE;
if (0==strcmp(word, "localtime")) return DBDPG_TRUE;
if (0==strcmp(word, "localtimestamp")) return DBDPG_TRUE;
if (0==strcmp(word, "location")) return DBDPG_TRUE;
if (0==strcmp(word, "lock")) return DBDPG_TRUE;
if (0==strcmp(word, "locked")) return DBDPG_TRUE;
if (0==strcmp(word, "logged")) return DBDPG_TRUE;
if (0==strcmp(word, "mapping")) return DBDPG_TRUE;
if (0==strcmp(word, "match")) return DBDPG_TRUE;
if (0==strcmp(word, "materialized")) return DBDPG_TRUE;
if (0==strcmp(word, "maxvalue")) return DBDPG_TRUE;
view all matches for this distribution
view release on metacpan or search on metacpan
} else {
test_str = "isnull";
}
} else if (word[0] < 'n') {
if (word[2] < 'g') {
test_str = "locked";
} else {
test_str = "logged";
}
} else if (word[0] < 'p') {
test_str = "nullif";
view all matches for this distribution