[jboss-user] [Beginner's Corner] - Jboss and Ejb with interceptors

ninguno2 do-not-reply at jboss.com
Sun Feb 26 12:20:20 EST 2012

ninguno2 [https://community.jboss.org/people/ninguno2] created the discussion

"Jboss and Ejb with interceptors"

To view the discussion, visit: https://community.jboss.org/message/719733#719733

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

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!

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120226/c633db8b/attachment.html 

More information about the jboss-user mailing list