2 Replies Latest reply on Jun 10, 2004 5:20 AM by Tom Vekemans

    Notifications and interceptors

    Kevin O'Neill Newbie

      I would like to create a simple system that notifies (via a jms queue) some external systems when entity data is updated.

      At first I thought "no probs, write an interceptor that queues the change" but no go you see the method call but you don't know if the method modifies the data.

      So my current thinking is to create a wrapping EntityPersistenceManager that notifies on the createEntity, storeEntity, and removeEntity methods. I'll need to make the class tx aware so it only sends the notifications when the tx is successfully commited.

      My problem is that is is alot more complex than adding an interceptor. Am I missing something, or is really the only way to do what I want?


        • 1. Re: Notifications and interceptors
          Dain Sundstrom Master

          I think Alexy resently added this to 4.0, and it is scheduleded to be back ported to 3.2. I think needed this for optimistic locking.

          • 2. Re: Notifications and interceptors
            Tom Vekemans Newbie

            I would also like to do this. I have an existing CMP based application, to which I must now add some kind of history reflecting who has changed what during program execution.

            I thought I would be able to write an interceptor to intercept all JDBC calls that are made to the database. I would then treat this info, add user info and send it to an MDB so that history tables could be appended with this information.

            I was capable of writing a proof of concept with a working simple interceptor and a message queue. However, I don't succeed in intercepting JDBC statements. Since the logger is capable of doing this I think I am missing something. Does anyone have an idea to point me in the right direction? Thanks in advance.

            Architecture used: Win2K server, JBoss 3.2.3 (soon to be 3.2.4) and MS SQLServer 2000.