• Post Reply Bookmark Topic Watch Topic
  • New Topic

Status bar for database loading  RSS feed

 
Chris Ernst
Ranch Hand
Posts: 36
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,
I have in my JSF 2.2 with PrimeFaces 5.3 serval Database querys to get data from diffrent Databases...
Because its take a little time to get the data, I want to have a status bar so that the user can see there is some aktion ;)

So how can I do it? I think start the bar is by click on  the search button but where must be the end point?
by the way, I can select the tables where I want to get the data from.

I hope you understand what I want to do :)

thanks for any ideas or help

cheers Chris
 
Tim Holloway
Bartender
Posts: 18514
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP is not an interactive protocol with asynchronous messages travelling both to and from the client to the server. Every HTTP request is paired with an HTTP response. So progress bars are fairly meaningless, as nothing at all comes back until everything is finished. And progress is therefore always either 0 or 100%.

With AJAX, you can get a form of progress monitoring, but only if the original request did not complete all processing. That is, instead of doing everything that needs doing on a single web request, the web request simply serves to start processing in an independent thread that an AJAX monitor back on the client page can poll periodically (since HTTP also doesn't permit servers to send unsolicited messages to clients).

HTTP services in J2EE are forbidden to spawn threads, however. If you do so, you can corrupt unrelated webapps and maybe even crash the server. So any processing engine threads you create have to be spawned (and shut down) outside of the HTTP services. Usually that's done in a ServletContextListener.
 
Chris Ernst
Ranch Hand
Posts: 36
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim, then I use maybe a growl message for each database request.
 
Chris Ernst
Ranch Hand
Posts: 36
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the best result for my question, for the people how want to do the same :)

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!