[jboss-user] [JBoss AOP] - Re: Catching LazyInitialization exception within an Intercep

mlouna do-not-reply at jboss.com
Fri Nov 30 03:35:01 EST 2007


You're absolutely right. 

I can cast the following to a set of Objects

Set<Object> mySet = (Set<Object>)methodInvocation.getCalledMethod().invoke(methodInvocation.getTargetObject(), methodInvocation.getArguments());
  | 		
and then loop through it with

Iterator iter = mySet.iterator();

In the particular cases where I know my object type I can call
parent.getChildren().getChildName() and indeed catch the thrown Lazy Init Exception

However in the general case where I have no knowledge of my object's getters/setters methods name, it is getting a bit more complicated.

Will have to think of method refelction solution. 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109173#4109173

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109173



More information about the jboss-user mailing list