| 3 |
# $Id$ |
# $Id$ |
| 4 |
# |
# |
| 5 |
# $Log$ |
# $Log$ |
| 6 |
|
# Revision 1.7 2003/06/25 22:59:59 joko |
| 7 |
|
# tweaked behaviour: only "->close" result if it is of type "Tangram::Cursor" |
| 8 |
|
# |
| 9 |
|
# Revision 1.6 2003/04/09 07:11:01 joko |
| 10 |
|
# minor fix |
| 11 |
|
# |
| 12 |
# Revision 1.5 2003/04/09 02:09:47 joko |
# Revision 1.5 2003/04/09 02:09:47 joko |
| 13 |
# bugfix: check for existance of '->close'-method before calling it on the 'RESULTHANDLE'-instance |
# bugfix: check for existance of '->close'-method before calling it on the 'RESULTHANDLE'-instance |
| 14 |
# |
# |
| 39 |
|
|
| 40 |
sub DESTROY { |
sub DESTROY { |
| 41 |
my $self = shift; |
my $self = shift; |
| 42 |
|
|
| 43 |
|
my $is_object = 0; |
| 44 |
|
|
| 45 |
#$logger->debug( __PACKAGE__ . "->" . "DESTROY" ); |
#$logger->debug( __PACKAGE__ . "->" . "DESTROY" ); |
| 46 |
$self->{RESULTHANDLE} && $self->{RESULTHANDLE}->can('close') && $self->{RESULTHANDLE}->close(); |
#eval { |
| 47 |
|
#print "ref: ", ref($self->{RESULTHANDLE}), "\n"; |
| 48 |
|
|
| 49 |
|
# object handle destructor |
| 50 |
|
if ($self->{resulthandle_type} eq 'Tangram::Cursor') { |
| 51 |
|
#$self->{RESULTHANDLE} && ref($self->{RESULTHANDLE}) && |
| 52 |
|
#ref($self->{RESULTHANDLE}) && $self->{RESULTHANDLE}->can('close') && $self->{RESULTHANDLE}->close(); |
| 53 |
|
$self->{RESULTHANDLE}->close(); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
# delete ref? |
| 57 |
|
delete $self->{RESULTHANDLE}; |
| 58 |
} |
} |
| 59 |
|
|
| 60 |
sub getNextEntry { |
sub getNextEntry { |
| 66 |
# is result already opened? |
# is result already opened? |
| 67 |
if ($self->{open}) { |
if ($self->{open}) { |
| 68 |
$self->{entry_count}++; |
$self->{entry_count}++; |
| 69 |
|
|
| 70 |
|
# NEW as of 2003-06-24: RESULTHANDLE == ARRAY |
| 71 |
|
return $self->{RESULTHANDLE}->[$self->{entry_count}] if (ref($self->{RESULTHANDLE}) eq 'ARRAY'); |
| 72 |
|
|
| 73 |
return $self->{RESULTHANDLE}->next() |
return $self->{RESULTHANDLE}->next() |
| 74 |
if $self->{resulthandle_type} eq 'Tangram::Cursor'; |
if $self->{resulthandle_type} eq 'Tangram::Cursor'; |
| 75 |
return $self->{members}->[$self->{entry_count}] |
return $self->{members}->[$self->{entry_count}] |
| 80 |
$self->{entry_count} = 0; |
$self->{entry_count} = 0; |
| 81 |
$self->{open} = 1; |
$self->{open} = 1; |
| 82 |
|
|
| 83 |
|
# NEW as of 2003-06-24: RESULTHANDLE == ARRAY |
| 84 |
|
return $self->{RESULTHANDLE}->[$self->{entry_count}] if (ref($self->{RESULTHANDLE}) eq 'ARRAY'); |
| 85 |
|
|
| 86 |
return $self->{RESULTHANDLE}->execute() |
return $self->{RESULTHANDLE}->execute() |
| 87 |
if $self->{resulthandle_type} eq 'Tangram::Cursor'; |
if $self->{resulthandle_type} eq 'Tangram::Cursor'; |
| 88 |
#print Dumper($self->{RESULTHANDLE}->members()); exit; |
#print Dumper($self->{RESULTHANDLE}->members()); exit; |
| 97 |
sub getStatus { |
sub getStatus { |
| 98 |
my $self = shift; |
my $self = shift; |
| 99 |
my $status; |
my $status; |
| 100 |
|
|
| 101 |
|
$self->{resulthandle_type} ||= ''; |
| 102 |
|
|
| 103 |
if ($self->{resulthandle_type} eq 'Tangram::Cursor') { |
if ($self->{resulthandle_type} eq 'Tangram::Cursor') { |
| 104 |
=pod |
=pod |
| 105 |
print Dumper($self->{RESULTHANDLE}); |
print Dumper($self->{RESULTHANDLE}); |