First of all, this is what my servlet is doing.
My servlet is used with a Quartz Scheduler to periodically send sms
content to subscribers. I use,
-MySQL = to store the content and subscribers' phone number
-Quartz scheduler = to do scheduling for delivery of contents
-Log4J = to log all delivery of contents
The problem: My servlet sends the content twice to a subscriber. It
suppose to just send once to each subscriber. My ResultSet return two
duplicated results for each rs.next()
Config:
Schelude of delivery is every Wed and Thur
Log file : cms.log
MySQL URL connection:
jdbc:mysql://178.547.22.345/best_cms?user=best_root&password=pass&autoReconnect=true&useUnicode=true&characterEncoding=ISO-8859-1
So far I've done some investigation and it seems that,
-When the scheduler is triggered, the app will start to send a content
to the listed subscribers. Say 1000 subscribers subscribe to
monophonic ringtone, then I shall set the scheduler to send one
monophonic ringtone to each subscribers.
-But the app seems to send two contents. I've tested on my dev server
(Windows XP) and it works well, but on my production server, the
problem happens.
I've done many checks on my SQL statements, (even putting the word
DISTINCT in), but to no avail. My troubleshooting ideas are that,
-Could it be a JDBC connection problem? Could I solve the problem by
putting a delay between connection to the MySQL and query?
-Or could it be the scheduler problem?
Please help.
Mel
Robert Klemme - 15 Apr 2004 12:52 GMT
> First of all, this is what my servlet is doing.
>
[quoted text clipped - 13 lines]
> Log file : cms.log
> MySQL URL connection:
jdbc:mysql://178.547.22.345/best_cms?user=best_root&password=pass&autoReco
nnect=true&useUnicode=true&characterEncoding=ISO-8859-1
> So far I've done some investigation and it seems that,
>
[quoted text clipped - 14 lines]
>
> -Or could it be the scheduler problem?
I'd first check the data. Maybe you simply loaded the set of data twice
into the database and have no indexes that prevented duplicate insertion.
If data is ok:
From what you write I'd guess that it's rather a scheduler problem. Maybe
you need to take action to ensure that a single event is not started
twice. Or you have two schedulers around that concurrently start the same
task.
Regards
robert