dcsimg
Refresh Functionality from JSP/EJB/Database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   VenkatRao_Konatalapalli
Posted On:   Thursday, August 23, 2001 02:06 PM

I was trying to achieve the functionlaity of displaying the realtime changes to the database using the JSP/EJB architecture working with Oracle.. I can not use Applets due to some restrictions... We could get it working using the HTTP-METAREGRESH tag , but every time the page is refreshed , it is hitting the database for any changes in the system... But I would like to enhance this idea by going for some kind of a mechanism which will refresh my JSP page only when there is a change in the Database... Just to give you a realtime example, it should work something similar to the Datek Online Streamer which refreshes the streamer whenever the stock quotes change.. Thanks for the time and help   More>>

I was trying to achieve the functionlaity of displaying the realtime changes to the database using the JSP/EJB architecture working with Oracle..


I can not use Applets due to some restrictions...

We could get it working using the HTTP-METAREGRESH tag , but every time the page is refreshed , it is hitting the database for any changes in the system...


But I would like to enhance this idea by going for some kind of a mechanism which will refresh my JSP page only when there is a change in the Database...


Just to give you a realtime example, it should work something similar to the Datek Online Streamer which refreshes the streamer whenever the stock quotes change..



Thanks for the time and help
-Venkat.

   <<Less

Re: Refresh Functionality from JSP/EJB/Database

Posted By:   Luigi_Viggiano  
Posted On:   Friday, August 24, 2001 07:41 AM

This is an idea, but I don't know if it is applicable: in the bottom of the JSP you can put a loop that prevents the page be completed by the browser: something like

while(! server.isDataChanged()) {
Thread.Sleep(5000);
}
//forward... to reload the page.

Supposing you have a "server" object with a isDataChanged() method returning true if the page needs an update.


So when the database changes the loop should end letting the page to be refreshed by redirecting the page or with any other mechanism (meta tags for example
).

I've never tried a thing like that, so I don't know if it will work, but you can tell us how you have solved this problem (I found it interresting).

About | Sitemap | Contact