TIMESTAMP: 20260816212251
SITE: shortenpublic
SERVER: ip-172-31-10-79.ec2.internal
URL: /iowa/short

Input:
    id = /faebb

ERRORS:
DatabaseDB::DB_EndTransaction database left locked at end of transaction DatabaseTransactionLevel: 1 locked: 1



/short
EVAL ERROR: DatabaseDB::DB_Del del Error deleting from:hash-LINK_CLICKS.period row::953867 status:-30986 at /usr/local/Iowa.git/lib/DatabaseDB.pm line 257.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	use LWP::UserAgent;
line 4: 	use URI::Escape;
line 5: 	use Digest::MD5 qw(md5_hex);
line 6: 
line 7: 	my $id = substr($Templates::in{'id'},1);
line 8: 	
line 9: 	my $h = hex($id) - 1000000;
line 10: 	if(&Database::ExistsRow($h,'LINK')) {
line 11: 		my %data;
line 12: 		&Database::GetRow($h,'LINK',\%data);
line 13: 		
line 14: 		my $period = substr(&Database::GetTimeStamp(),0,8);
line 15: 		&Database::BeginTransaction(1);
line 16: 
line 17: 		my ($hist, %hist_data);
line 18: 		my @hist_sel = &Database::SelectClause('LINK_CLICKS',"parent = LINK.$h and period = $period");
line 19: 		if(!@hist_sel) {
line 20: 			$hist = &Database::Allocate('LINK_CLICKS',"LINK.$h");
line 21: 		}
line 22: 		else {
line 23: 			$hist = $hist_sel[0];
line 24: 		}
line 25: 		&Database::GetRow($hist,'LINK_CLICKS',\%hist_data);
line 26: 		$hist_data{'period'} = $period;
line 27: 		++$hist_data{'count'};
line 28: 		&Database::SaveRow($hist,'LINK_CLICKS',\%hist_data);
line 29: 		&Database::EndTransaction(1);
line 30: 		
line 31: 		&Templates::SetNoCache();
line 32: 		&Templates::SetHeader('Status','301');
line 33: 		&Templates::SetHeader('Location',$data{'url'});
line 34: 
line 35: 		my $ip = $main::ENV{'REMOTE_ADDR'};
line 36: 
line 37: 		my %payload;
line 38: 		$payload{'v'} = '1';
line 39: 		$payload{'tid'} = 'UA-15906914-2';
line 40: 		$payload{'t'} = 'event';
line 41: 		$payload{'ec'} = 'pw-ne.ws';
line 42: 		$payload{'ea'} = 'click';
line 43: 		$payload{'cid'} = md5_hex($ip);
line 44: 		$payload{'ip'} = $ip;
line 45: 		$payload{'ua'} = $ENV{'HTTP_USER_AGENT'};
line 46: 		$payload{'el'} = $data{'url'};
line 47: 
line 48: 		my $ua = LWP::UserAgent->new();
line 49: 		$ua->agent($ENV{'HTTP_USER_AGENT'});
line 50: 	
line 51: 		my $response = $ua->post( 'http://www.google-analytics.com/collect', \%payload );
line 52: 		if ($response->is_success) {
line 53: 			# print $response->decoded_content;
line 54: 		}
line 55: 		else {
line 56: 			# print $response->status_line;
line 57: 		}
line 58: 
line 59: 	}
line 60: 	else {
line 61: 		&Templates::SetHeader('Status','404');
line 62: 	}
line 63:  };
line 64: &doEval();
line 65: 1;