Baliukas
I think if what we are discussing is true then we have found the root of the problem.
I downloded hibernate 213 src and 214 src both and in both fast class is use in 3 classes as shown below and in all three it is
Quote:
FastClass.create(class)
and not
Quote:
FastClass.create(loader,class)
.
Here are the codes
1Quote:
net.sf.hibernate.util.ReflectHelper
public static BulkBean getBulkBean(Class clazz, String[] getterNames, String[] setterNames, Class[] types){
try {
BulkBean optimizer = BulkBean.create(clazz, getterNames, setterNames, types);
if ( !clazz.isInterface() ) {
//test out the optimizer:
Object instance = FastClass.create(clazz).newInstance();
optimizer.setPropertyValues( instance, optimizer.getPropertyValues(instance) );
}
//if working:
return optimizer;
}catch....
2Quote:
net.sf.hibernate.type.ComponentType
public ComponentType(
Class componentClass,
String[] propertyNames,
Getter[] propertyGetters,
Setter[] propertySetters,
final boolean foundCustomAccessor,
Type[] propertyTypes,
int[] joinedFetch,
Cascades.CascadeStyle[] cascade,
String parentProperty
) throws MappingException {
this.componentClass = componentClass;
this.propertyTypes = propertyTypes;
getters = propertyGetters;
setters = propertySetters;
propertySpan = propertyNames.length;
String[] getterNames = new String[propertySpan];
String[] setterNames = new String[propertySpan];
Class[] propTypes = new Class[propertySpan];
for ( int i=0; i<propertySpan; i++ ) {
getterNames[i] = getters[i].getMethodName();
setterNames[i] = setters[i].getMethodName();
propTypes[i] = getters[i].getReturnType();
}
if (parentProperty==null) {
parentSetter=null;
parentGetter=null;
}
else {
PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor(null);
parentSetter = pa.getSetter(componentClass, parentProperty);
parentGetter = pa.getGetter(componentClass, parentProperty);
}
this.propertyNames = propertyNames;
this.cascade = cascade;
this.joinedFetch = joinedFetch;
constructor = ReflectHelper.getDefaultConstructor(componentClass);
optimizer = !foundCustomAccessor && Environment.useReflectionOptimizer() ?
ReflectHelper.getBulkBean(componentClass, getterNames, setterNames, propTypes) :
null;
fastClass = FastClass.create(componentClass);
}
3Quote:
net.sf.hibernate.persister.AbstractEntityPersister
protected AbstractEntityPersister(PersistentClass model, SessionFactoryImplementor factory) throws HibernateException {
.....
optimizer = !foundCustomAccessor && Environment.useReflectionOptimizer() ?
ReflectHelper.getBulkBean(mappedClass, getterNames, setterNames, types) :
null;
fastClass = FastClass.create(mappedClass); //line 756
So i think we will also have to change the hibernate code for the garbage collection to work !
Hibernate Team,
Is it ok if i change and test the hibernate code after i get the latest cglib code from Baliukas locally in my systems and then mail it to someone in the hibernate team to test and merge to hibernate ?
Regards
Suchak Jani