Is there an easy way to timeout the SQL statement so that it works, rather than expecting (for example, delivering an empty result set or an error message or something else) so that I can allow ressource to refuse reservation and give another chance? I am looking for some version of DBI that I still forgot; sending SIGALRM to myself to commit suicide is probably not what I mean (although I might have to resort to it if I had to).
The compiled code is pseudo-measured and abbreviated to the extreme, but I hope you catch the drift.
my $sql = "SELECT one, two, three FROM sometable WHERE this = ? AND that = ?";
my $sth = $self->make_handle( $sql );
eval {
foreach my $this ( sort keys %needed_ressources ) {
$sth->execute( $this, $that ) or die( "DB connection gone?!" );
my ( $one, $two, $three ) = $sth->fetchrow_array();
unless( $one ) {
$self->{DB_HANDLE}->rollback();
die( "$this not defined for $that!" );
}
}
foreach...
$self->{DB_HANDLE}->commit();
};
return( 1 ) unless $@;
return( undef );
Here are the details for those interested:
, , ressource, . / . , , ( ).
, "SELECT... FOR UPDATE", Oracle , . , , , , .
. " " , Oracle , , , , , . , , . un , , , .
RTFM, M, TF R; -))
,
Olfan