3 Replies Latest reply on Mar 6, 2002 12:06 PM by dsundstrom

    Automatic Refresh of DB change in GUI

    bhawks

      Using CMP, I want to be able to synchronize any database updates made by my clients to all other clients to my business logic.

      Can someone tell me if I must write the refresh code into the business logic or is there a callback mechanism already provided by EJB's.

      TIA

        • 1. Re: Automatic Refresh of DB change in GUI

          There is not a callback mechanism in EJBs per se, but what you probably want is message driven beans. Unless you are making a DB change outside the scope of the EJBs, you can have a bean post to a queue/topic when it is updated.

          • 2. Re: Automatic Refresh of DB change in GUI
            davidjencks

            This is extremely difficult to get 100% accurate -- there is always a time delay in which the other clients can get or use stale data. The best, if you need accurate data, is probably using db locking via select for update and commit option B or C. If you don't care about clients using data that is slightly out of date you could use messages or build a distributed state system with javagroups.

            • 3. Re: Automatic Refresh of DB change in GUI
              dsundstrom

              I highly recommend dropping this feature. I will only lead to user confusion, and will take you forever to iron out all the bugs. Instead I suggest that you put a big time stamp on your gui and refresh button.