This worked with an earlier version. My persistet model objects are all JavaBeans i.e. they fire PropertyChangeEvents when changing an attribute. I need this for certain reasons. But for today ( I upgraded to 3.1.2 plus I changed to use the Java PopoertyChangeSupport had a homegrown solution before) I have a problem when Hibernate tries to merge an entity. It then obviously tries to set an List attribute which causes the PropertyChangeSupport.firePropertyChange to be called (this is new in my code, i had a different lib there before so maybe it is not the upgrading that makes me fail). the firepropertyChange (even if there are no listeners at all, I tested this) does an equals on the list which results in the error shown below. What can I do to get araund this
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Code:
Session session = Application.sessionFactory.openSession();
Transaction tx = session.beginTransaction();
session.merge(model);
tx.commit();
session.close();
Full stack trace of any exception that occurs:Code:
18:47:57,021 ERROR LazyInitializationException:19 - illegal access to loading collection
org.hibernate.LazyInitializationException: illegal access to loading collection
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.listIterator(PersistentBag.java:422)
at java.util.AbstractList.equals(AbstractList.java:606)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:267)
at eiswind.paris.model.bean.ModelObject.firePropertyChange(ModelObject.java:39)
at eiswind.paris.model.Category.setChildren(Category.java:71)
at eiswind.paris.model.Category$$BulkBeanByCGLIB$$4853615e.setPropertyValues(<generated>)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)
at ...
Name and version of the database you are using:
Postgres 8
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
[code]