[jboss-user] [JBoss AOP] - Re: Catching LazyInitialization exception within an Intercep
jtonic
do-not-reply at jboss.com
Fri Nov 30 11:20:57 EST 2007
anonymous wrote : 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.
You are very right. I'm working also for a LIE solution, but I use some hibernate stuff. I have also the same problem that U've mentioned. IMHO reflection is the solution.
The following are the hibernate methods that help me doing the LIE interceptor:
Hibernate.isInitialized(object);
Hibernate.initialize(object);
session.lock(object, LockType);
Regards, jtonic
"mlouna" wrote : 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=4109378#4109378
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109378
More information about the jboss-user
mailing list