projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8ca0534
)
does pg try to finish the query when the job addition is committed? well, if this...
author
ivan
<ivan>
Thu, 23 Apr 2009 04:14:54 +0000
(
04:14
+0000)
committer
ivan
<ivan>
Thu, 23 Apr 2009 04:14:54 +0000
(
04:14
+0000)
FS/FS/Cron/bill.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Cron/bill.pm
b/FS/FS/Cron/bill.pm
index
4e88173
..
5101e0d
100644
(file)
--- a/
FS/FS/Cron/bill.pm
+++ b/
FS/FS/Cron/bill.pm
@@
-4,6
+4,7
@@
use strict;
use vars qw( @ISA @EXPORT_OK );
use Exporter;
use Date::Parse;
use vars qw( @ISA @EXPORT_OK );
use Exporter;
use Date::Parse;
+use DBI 1.33; #The "clone" method was added in DBI 1.33.
use FS::UID qw(dbh);
use FS::Record qw(qsearchs);
use FS::cust_main;
use FS::UID qw(dbh);
use FS::Record qw(qsearchs);
use FS::cust_main;
@@
-102,16
+103,18
@@
END
warn "searching for customers:\n". join("\n", @search). "\n"
if $opt{'v'} || $opt{'l'};
warn "searching for customers:\n". join("\n", @search). "\n"
if $opt{'v'} || $opt{'l'};
- dbh->do(
- "DECLARE cron_bill_cursor CURSOR WITH HOLD FOR ". #no WITH HOLD for mysql?
+ my $cursor_dbh = dbh->clone;
+
+ $cursor_dbh->do(
+ "DECLARE cron_bill_cursor CURSOR FOR ".
" SELECT custnum FROM cust_main ".
" WHERE ". join(' AND ', @search).
" ORDER BY custnum " #LIMIT 1000 "
" SELECT custnum FROM cust_main ".
" WHERE ". join(' AND ', @search).
" ORDER BY custnum " #LIMIT 1000 "
- ) or die dbh->errstr;
+ ) or die
$cursor_
dbh->errstr;
while ( 1 ) {
while ( 1 ) {
- my $sth =
dbh->prepare('FETCH 10
00 FROM cron_bill_cursor'); #mysql?
+ my $sth =
$cursor_dbh->prepare('FETCH 1
00 FROM cron_bill_cursor'); #mysql?
$sth->execute or die $sth->errstr;
$sth->execute or die $sth->errstr;
@@
-156,6
+159,8
@@
END
}
}
+ $cursor_dbh->commit or die $cursor_dbh->errstr;
+
}
1;
}
1;