3 Replies Latest reply on Feb 15, 2002 3:16 AM by mannu

    very interesting (?) question + warjort

    mannu Newbie

      My very important question is the next one:
      I have a db linked to ejb entities. That's meaning that I have to ways to add data:
      first one: create ejb entity, which will update my db; and second one: directly by accessing to my db.
      In this second case, does jboss server know (because of the .ldb?)in the same time that a new data has been added (without doing a findall() on my ejb), and then could I make an event, like a message or another update to another database? In other terms, is jboss able to detect changes in a database, and then, produce an event in background, without showing anything to any users.

      Make sure, I would be very very happy to have many responses, specialy from warjort, my master...

        • 1. Re: very interesting (?) question + warjort
          Franco Apprentice

          Hi,
          you should look at CommitOption (C ? ).

          Ciao.

          • 2. Re: very interesting (?) question + warjort
            David Jencks Master

            there's no built in way to notify jboss that your db has changed. If you use commit option = B or C you will reload within each transaction so will pick up changes to already loaded entities. Any commit option should pick up new/removed rows in the db (at least if you aren't using findByPrimaryKey, which with option A may look in the cache first and assume it is correct, I'm not sure one way or the other about this.).

            There may be some way to send a notification using e.g. java stored procedures in Oracle or something attached to Firebird/Interbase events that "something changed". However all such schemes are at best extremely difficult to get fully synchronized so that your application is guaranteed to be notified of any change before it tries to use the old version of the data.

            • 3. Re: very interesting (?) question + warjort
              mannu Newbie

              thank you very much fbiaggi and davidjencks, I am going to try your solution.
              Have a nice WE...