Gossamer Forum
Home : Products : DBMan : Customization :

dbman dies after 50 entries

Quote Reply
dbman dies after 50 entries
Hi folks, I have a copy of dbman with the validation script installed. Everything seemed to be running just fine until I received my 51st record.....then the dreaded "Internal Server Error" appears. I checked my error log files and I get "premature end of script" error. When I delete a few records and resent the counter file everything works fine again...till record 51.....

I'm using the record id number as the db key.....

Any thoughts? Thanks guys
Quote Reply
Re: [steven99] dbman dies after 50 entries In reply to
The actual server error log entry reads:

Premature end of script headers:

thanks
Quote Reply
Re: [steven99] dbman dies after 50 entries In reply to
Search in the FAQ under the section "Admin" for a thread called "Prevent Duplicate ID # due to page Reload"

It could be the script is having problems within sub add_record where it checks for the next available key. It currently is setup to give up after 50 times.

Here's the thread reference fix:


Prevent Duplicate ID # due to page Reload

in HTML.PL

Add this to top of your file for reference of changes made:
### prevent NEW ID on reload - added codes in sub html_add_failure

sub html_add_failure {
# --------------------------------------------------------

AFTER:
my ($message) = $_[0]; add:

### prevent dup ID # . . also commented out code in .cgi sub add_record ###
if ($message eq "duplicate key error") {
&html_home;
return;
}
### prevent dup ID numbers ####

In your .CGI: in sub add_record

Add this to top of your file for reference of changes made:
# prevent NEW ID on reload - removed codes in sub add_record

AFTER: # First we validate the record to make sure the addition is ok.
$status = &validate_record;

##### comment out the following to prevent a new ID # being assigned when the form
is reloaded ####
## We keep checking for the next available key, or until we've tried 50 times after which
we give up.
# while ($status eq "duplicate key error" and $db_key_track) {
# return "duplicate key error" if ($counter++ > 50);
# $in{$db_key}++;
# $status = &validate_record;
# }

This is fully tested and works great!


Let us know if that solves your problem.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/