Hi All -
I have a Set collection mapped with a composite-element.
I'm using spring, and after each session.load(), the session is flushed.
With this collection, during the flush the collection is deemed dirty, which causes a chain reaction of updates and cache invalidations that I don't want.
Any suggestions on what is making this collection be interpreted as dirty on every load?
the mapping for this set looks like:
Code:
<set
name="invitationAddlContacts"
table="INVITATION_ADDL_CONTACT"
lazy="false"
inverse="true"
cascade="all"
sort="unsorted"
>
<cache
usage="nonstrict-read-write"
/>
<key
column="INVITATION_ID"
/>
<composite-element
class="com.benefitpoint.cmp.marketing.invitation.InvitationAddlContact"
>
<property
name="email"
type="java.lang.String"
update="true"
insert="true"
column="EMAIL_ADDR"
/>
<property
name="firstname"
type="java.lang.String"
update="true"
insert="true"
column="FIRST_NAME"
/>
<property
name="lastname"
type="java.lang.String"
update="true"
insert="true"
column="LAST_NAME"
/>
</composite-element>
</set>
my hibernate log looks like:
Code:
DEBUG|11:25:00.837|net.sf.hibernate.impl.BatcherImpl|prepared statement get: select invitati0_.EMAIL_ADDR as EMAIL_ADDR_
_, invitati0_.FIRST_NAME as FIRST_NAME__, invitati0_.LAST_NAME as LAST_NAME__, invitati0_.INVITATION_ID as INVITATI1___
from INVITATION_ADDL_CONTACT invitati0_ where invitati0_.INVITATION_ID=?
DEBUG|11:25:00.837|net.sf.hibernate.impl.BatcherImpl|preparing statement
DEBUG|11:25:00.837|net.sf.hibernate.type.IntegerType|binding '22' to parameter: 1
DEBUG|11:25:00.837|net.sf.hibernate.loader.Loader|result set contains (possibly empty) collection: [com.benefitpoint.cmp
.marketing.invitation.Invitation.invitationAddlContacts#22]
DEBUG|11:25:00.837|net.sf.hibernate.impl.SessionImpl|uninitialized collection: initializing
DEBUG|11:25:00.837|net.sf.hibernate.loader.Loader|processing result set
DEBUG|11:25:00.837|net.sf.hibernate.loader.Loader|result row:
DEBUG|11:25:00.837|net.sf.hibernate.type.IntegerType|returning '22' as column: INVITATI1___
DEBUG|11:25:00.837|net.sf.hibernate.loader.Loader|found row of collection: [com.benefitpoint.cmp.marketing.invitation.In
vitation.invitationAddlContacts#22]
DEBUG|11:25:00.837|net.sf.hibernate.impl.SessionImpl|reading row
DEBUG|11:25:00.837|net.sf.hibernate.type.StringType|returning 'email1' as column: EMAIL_ADDR__
DEBUG|11:25:00.837|net.sf.hibernate.type.StringType|returning 'firstname1' as column: FIRST_NAME__
DEBUG|11:25:00.837|net.sf.hibernate.type.StringType|returning 'lastname1' as column: LAST_NAME__
DEBUG|11:25:00.837|net.sf.hibernate.loader.Loader|result row:
DEBUG|11:25:00.837|net.sf.hibernate.type.IntegerType|returning '22' as column: INVITATI1___
DEBUG|11:25:00.837|net.sf.hibernate.loader.Loader|found row of collection: [com.benefitpoint.cmp.marketing.invitation.In
vitation.invitationAddlContacts#22]
DEBUG|11:25:00.837|net.sf.hibernate.impl.SessionImpl|reading row
DEBUG|11:25:00.837|net.sf.hibernate.type.StringType|returning 'email2' as column: EMAIL_ADDR__
DEBUG|11:25:00.852|net.sf.hibernate.type.StringType|returning 'firstname2' as column: FIRST_NAME__
DEBUG|11:25:00.852|net.sf.hibernate.type.StringType|returning 'lastname2' as column: LAST_NAME__
DEBUG|11:25:00.852|net.sf.hibernate.loader.Loader|done processing result set (2 rows)
DEBUG|11:25:00.852|net.sf.hibernate.impl.BatcherImpl|done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG|11:25:00.852|net.sf.hibernate.impl.BatcherImpl|closing statement
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|1 collections were found in result set
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|Caching collection: [com.benefitpoint.cmp.marketing.invitation.Invi
tation.invitationAddlContacts#22]
DEBUG|11:25:00.852|net.sf.hibernate.cache.ReadWriteCache|Updating: 22
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|collection fully initialized: [com.benefitpoint.cmp.marketing.invit
ation.Invitation.invitationAddlContacts#22]
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|1 collections initialized
DEBUG|11:25:00.852|org.springframework.transaction.support.TransactionSynchronizationManager|Triggering beforeCommit syn
chronization
DEBUG|11:25:00.852|org.springframework.orm.hibernate.SessionFactoryUtils|Flushing Hibernate session on transaction synch
ronization
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|flushing session
DEBUG|11:25:00.852|net.sf.hibernate.engine.Cascades|processing cascades for: com.benefitpoint.cmp.marketing.invitation.I
nvitation
DEBUG|11:25:00.852|net.sf.hibernate.engine.Cascades|cascading to collection: com.benefitpoint.cmp.marketing.invitation.I
nvitation.invitationAddlContacts
DEBUG|11:25:00.852|net.sf.hibernate.engine.Cascades|done processing cascades for: com.benefitpoint.cmp.marketing.invitat
ion.Invitation
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|Collection dirty: [com.benefitpoint.cmp.marketing.invitation.Invita
tion.invitationAddlContacts#22]
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|Flushing entities and processing referenced collections
DEBUG|11:25:00.852|net.sf.hibernate.impl.SessionImpl|Updating entity: [com.benefitpoint.cmp.marketing.invitation.Invitat
ion#22]
DEBUG|11:25:00.852|net.sf.hibernate.engine.Versioning|Incrementing: 197 to 198