We are using JBoss for session beans. We have a dynamic proxy creator for finding the required bean then invoking the method, somthing like DynamicProxyCreator => InvocationHandler => ServiceLocator pattern. Which is fine although the transaction in one bean is not rolling back. For example bean one does a database call then calls bean two. Bean two calls JMS then returns fine. Bean one then fails. One would expect that the database and the JMS are rolled back, but the beans are not in the same transaction, so bean one is rolled back but the JMS gets sent.
Why is this? Due to the proxy class generation?
I tried to get the object straight from JNDI with the usual initialContext.lookup("jndi/name"), which should return the home interface, but I get a $ProxyXX in return. The proxy does not implement the home interface so I can't cast it, and the only way to get hold of the method required is via reflection, very inefficient of course, and messy too.
Please help! At wits end here.
Thanks in advance.