6 Replies Latest reply on Mar 11, 2012 10:55 AM by ninguno2

    Jboss and Ejb with interceptors

    ninguno2

      I'm using Jboss 4.2.3 + hibernate 3.3 with jta; Jboss is managing my hibernatesession, that I obtain with sessionFactory.getCurrentSession().

       

      I have a session bean that has several mutually exclusive methods (when one is executing the other should be block). I implement and interceptor using a RecurrentLock to get this working (attached through annotations to the session bean), and is working almost fine.

       

      But I need that this kind of "lock" interceptor is executed before the jta transacion starts and after the jta ends (and commit my hibernate changes), cause now is going the other way. Is there any way to get this working?

       

      A simple schema if my problem it's not understood

       

      Now

      1-JTA tran. starts

      2-Lock with custom interceptor

      3-Ejb method called

      4-Unlock with custom interceptor

      5-jta tran. ends and commit changes.

       

      I need

      1-Lock with custom interceptor

      2-JTA tran. starts

      3-Ejb method called

      4-jta tran. ends and commit changes.

      5-Unlock with custom interceptor

       

      Thanks in advance and sorry about me english!