I've got lazy loading collections working fine in other areas on the same code, but I can't figure out why a select on a Licence class which has a lazy=true one-to-many collection would result in a version update on Licence? I don't actually want the collection, and the collection is not brought back as can be seen in the log ([com.med.dom.Licence.points#1] (uninitialized)), but then AbstractFlushingEventListener says there is 1 update - within miliseconds of each other in the log??
Its been half a day now on this and I need some help!
Thanks,
adam
hql: from License where entitiyId = x;
2006-09-14 15:33:05,312 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.med.dom.Licence#1]
2006-09-14 15:33:05,312 DEBUG [org.hibernate.engine.StatefulPersistenceContext] - initializing non-lazy collections
2006-09-14 15:33:05,312 DEBUG [org.hibernate.jdbc.ConnectionManager] - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
2006-09-14 15:33:05,312 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - processing flush-time cascades
2006-09-14 15:33:05,312 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - dirty checking collections
2006-09-14 15:33:05,312 DEBUG [org.hibernate.engine.Collections] - Collection found: [com.med.dom.Licence.points#1], was: [com.med.dom.Licence.points#1] (uninitialized)
2006-09-14 15:33:05,312 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
2006-09-14 15:33:05,312 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 0 (re)creations, 0 updates, 0 removals to 1 collections
2006-09-14 15:33:05,312 DEBUG [org.hibernate.pretty.Printer] - listing entities:
2006-09-14 15:33:05,328 DEBUG [org.hibernate.pretty.Printer] - com.med.dom.Licence{roadSideExpiry=component[day,month,year]{month=null, day=null, year=null}, usersId=10, type=, notes=null, algorithm=null, points=<uninitialized>, id=1, roadSideCalloutNumber=null, version=6, internationalNumber=null, noClaimsStart=component[day,month,year]{month=null, day=null, year=null}, roadSideAccount=null, roadSideNumber=null, name=test54, roadSideInsurer=null, number=}
2006-09-14 15:33:05,328 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2006-09-14 15:33:05,328 DEBUG [org.hibernate.SQL] - update licences set version=?, usersId=?, algorithm=?, name=?, type=?, number=?, internationalnumber=?, noclaimsstartday=?, noclaimsstartmonth=?, noclaimsstartyear=?, roadsideinsurer=?, roadsideaccount=?, roadsidenumber=?, roadsidecalloutnumber=?, roadsideexpiryday=?, roadsideexpirymonth=?, roadsideexpiryyear=?, notes=? where id=? and version=?
2006-09-14 15:33:05,359 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2006-09-14 15:33:05,359 DEBUG [org.hibernate.jdbc.ConnectionManager] - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2006-09-14 15:33:05,359 DEBUG [org.hibernate.jdbc.ConnectionManager] - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
mapping file:
<class name="Licence" table="licences" lazy="true">
<id name="id" column="id" type="long" unsaved-value="null">
<generator class="identity"/>
</id>
<version name="version"/>
...
<set name="points" cascade="all-delete-orphan" lazy="true" inverse="true" order-by="id asc">
<key column="licencesId"/>
<one-to-many class="LicencePoint"/>
</set>
|