ramitpagaria / asb-myads

Automatically exported from code.google.com/p/asb-myads
0 stars 0 forks source link

Ads disappeared on 01/02/2011 #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ads disappeared from my website, at 01/02/2011, but was back again 02/02/2011. 
Why is this, and what can be done to fix this problem if it occurs again. 

This issue did also occur on my trial version on Openadstore.com

Ola 

Original issue reported on code.google.com by Ola.Gje...@gmail.com on 3 Feb 2011 at 1:05

GoogleCodeExporter commented 9 years ago
There seem to be no reason for this to happen. It's also hard to reproduce. Do 
you imply that ads are disappearing on 1st of each month? To claim that you 
should request ads every 1-2 minutes throughout the 24 hours of the day (1st of 
a month). I doubt you did that. So the reason for ads not displayed can be way 
different. Eg. capping or start/end date - which is absolutely valid.

We will investigate this issue closer if it happens again. We have done many 
changes since that issue was posted here. 

Original comment by adserver...@gmail.com on 22 Feb 2011 at 3:56

GoogleCodeExporter commented 9 years ago
We found and fixed the bug, the fix is not available in 0.6 (currently the 
latest in downloads).
You can either make the following change or wait until the release of 0.7

So, find db/procs/is_valid_day_of_week.sql and replace its content with the 
following:

DELIMITER ;;
DROP FUNCTION if exists is_valid_day_of_week;
CREATE FUNCTION is_valid_day_of_week(day_bits VARCHAR(7), now_date_time 
TIMESTAMP )
RETURNS BOOL
DETERMINISTIC
NO SQL
BEGIN
 DECLARE currentWeekDay INTEGER;
 -- SET currentWeekDay = WEEKDAY(DATE(now_date_time)); - if week starts on Monday
 SET currentWeekDay = DAYOFWEEK(DATE(now_date_time)-1); -- if week starts on Sunday
 IF (SUBSTRING(day_bits,currentWeekDay+1,1)='1') THEN RETURN TRUE;END IF;

 RETURN FALSE;
END
;;
delimiter ;

Original comment by adserver...@gmail.com on 30 Mar 2011 at 12:28

GoogleCodeExporter commented 9 years ago

Original comment by adserver...@gmail.com on 30 Mar 2011 at 12:38

GoogleCodeExporter commented 9 years ago
Also need to set
<USER_HOME>/.dbProperties
And set flag db.update.required=true

Original comment by litnimax...@gmail.com on 1 Apr 2011 at 7:19

GoogleCodeExporter commented 9 years ago
The right proc:

DELIMITER ;;
DROP FUNCTION if exists is_valid_day_of_week;
CREATE FUNCTION is_valid_day_of_week(day_bits VARCHAR(7), now_date_time 
TIMESTAMP )
RETURNS BOOL
DETERMINISTIC
NO SQL
BEGIN
  RETURN SUBSTRING(day_bits,DAYOFWEEK(now_date_time),1)='1';
END
;;
delimiter ;

Original comment by litnimax...@gmail.com on 1 Apr 2011 at 9:11

GoogleCodeExporter commented 9 years ago
To clarify this comment:

Also need to set
<USER_HOME>/.dbProperties
And set flag db.update.required=true

This is necessary to bring up the installer on Tomcat restart. And you need to 
bring up the installer to update procedures and functions in DB. Of course you 
need to rebuild the project first with the updated version of the function.

Another way to update a function / procedure in the DB is simply using mysql 
dbname < file.sql syntax. I think this would be much easier. Don't forget to do 
it for all db instances you have.

Original comment by adserver...@gmail.com on 1 Apr 2011 at 9:25