See my more explaination below :- -----Original Message----- From: Luca Ventura [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 2:00 PM To: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. c: Bhushan_Bhangale Subject: R: R: R: How can I implement a PUSH service in Java?
Luca, I have worked on a following type of application for http://www.applevacations.com It is a travel information portal. User come to the site and can register on it by giving some preferences about his/her travel parameters(price ranges, durations, seasons, destinations, etc). We store all this info in seperate tables with user id. The applevacations company announces various packages for travel on a regular basis but wanted to send e-mails to users weekly according to the preferences choosen by them. We developed a Java AWT application for doing the above job. We have created a stored procedure in database which used to run daily by a scheduler in the database and populates a table with the user data and the package announced according to his/her preferences. >IN WHICH PROGRAMMING LANGUAGE IS THE "STORED PROCEDURE" IMPLEMENTED? SQL? HOW CAN YOU BE SURE THAT WHEN YOU INSERT A USER AND HIS PREFERENCES IN THE TABLE THIS USER ISN'T ALREADY PRESENT? DID YOU DO ANY CHECK? WHICH DATABASE DO YOU USE? OR DO YOU CREATE A NEW TABLE "Populated table" EVERY DAY TO AVOID THIS PROBLEM? >> We used SQL in DB2 database for writing Stored procedure. Our client asked us to >take e-mail address as unique and make it as login-id. The "Populated table" is same >always. We romove the entries in it whose mail sent flag is "Y" and dump into some >backup tables. Later on when the application gets trigger it reads that populated table and sends mail to the user one by one. > HOW DOES THE APPLICATION GET THE TRIGGER? WHAT STARTS THE TRIGGER? DOES THE JAVA APPLICATION RUNS FOREVER AS A LISTENER? >> Every Operating System provides scheduler mechanism. We used windows NT in our >project so we used its Scheduler. The populated table normally has 10,00,000 records which used to take 4-6 hrs to complete the whole job. Parallely it sets the Mail sent flag of Populated table to Y so that next time when the application runs it doesn't send the mail again which is already sent. > AFTER YOU SET TO "Y" THE FLAG WHAT HAPPENS? IF YOU HAVE NEW USEFUL INFORMATION FOR THE USER DURING THE DAY HOW CAN YOU SEND MAILS TO HIM? IN FACT THE FLAG IS STILL SET TO "Y"...OR NOT? >> When ever new info comes it gets populated in the "Populated table" with the mail >sent flag as "N" to all the users whose preferences matched with the new info. The >requirement here was weekly so when the application runs only then the mail goes to >the users. Let me tell you the main structure of tables(dropping least required fields):- User table -> User Id, Mail Id (User Id unique) Preferred Price Ranges table -> User Id, Price Range Id (User Id & Price Range Id should be unique, Price Range Id corresponds to some price range defined in a master table) Preferred Durations table -> User Id, Duration Id (User Id & Duration Id should be unique, Duration Id corresponds to some durations defined in a master table) Preferred Seasons table -> User Id, Seasons Id (User Id & Seasons Id should be unique, Seasons Id corresponds to some Seasons defined in a master table) Preferred Destinations table -> User Id, Destinations Id (User Id & Destinations Id should be unique, Destinations Id corresponds to some Destinations defined in a master table) Packages Table -> Package Id, Price Range Id, Duration Id, Season Id, Destination Id Populated table -> User Id, Mail Id, Package Id, Price Range Id, Duration Id, Season Id, Destination Id, Mail Sent flag. I hope this will help you. Thanks & Regards Bhushan Bhangale Infosys Technologies Ltd. Pune - 411042 Tel : (Office) +91 (20) 2932800 Ext - 1176 Mobile : +91 9822454603 E-mail : [EMAIL PROTECTED] ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
