Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make database change cause updates to web clients' views
    primarykey
    data
    text
    <p>Environment: Java EE 7, Glassfish 4, MySQL 5.7 on Linux on an ARM7 server with 512MB ram (app must be memory frugal!) Application: A database-driven Java web app served to multiple Android tablet clients running Android 4.0 with the default browser. </p> <p>The clients will have two basic user types: Producers and Consumers. Producers generate Tasks that are displayed on Consumers' browsers. When a Producer creates a new Task, it should immediately show up on all logged-in Consumers' browsers if they have the TaskList (viewTaskList.jsp) displayed with a "PENDING" status. Consumers select Tasks from the TaskList and process them (doTask.jsp). When as Task is selected by a Consumer, it should be flagged as "WORKING" on all other TaskList displays and not be selectable. If the Consumer who has a Task open clicks a Cancel button, the Task status should be changed to "PENDING" on all TaskLists. When a Task is completed, it is flagged as such, and should disappear from any Consumers' browsers that are displaying the TaskList view. </p> <p><a href="http://mjnemr.com/viewTaskList.html" rel="nofollow">Sample TaskList view</a></p> <pre><code>Task entity class: (fragment) public class Task { private int taskId; private String taskDescription; private boolean isComplete; private String completerId; // the userId of the Consumer who marked this as Complete (foreign key); private boolean isLocked; private String lockId; // the userId of a Consumer who has this task open; . . . } </code></pre> <p>I am learning to do Java EE programming, and not proficient in JPA and JSF yet, but understand the basic concepts. From what I've seen here and elsewhere, I think Comet and/or JQuery/AJAX may help me solve this, but I don't know how to use either of those. I need basic guidance in how to have the database updates cause changes to the Consumers' displays, without the Consumers requesting the changes. Is part of the solution adding one or more triggers to the MySQL database?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload