More details.
This happens when there is a flush after the load. I had left part of the
function out to be brief. Here is the whole function:
Message message = null;
MessageBoxEntry entry =
(MessageBoxEntry)session.load(MessageBoxEntry.class, aMessageBoxEntryId);
if (entry != null) {
message = entry.getMessage();
if (!entry.isRead()) {
entry.setRead(Boolean.TRUE);
session.update(entry);
session.flush(); //*** should only update the
read_flag field on message_box_entry
}
}
return message.getText();
Do I need to do the update in a seperate session from the load to make this
work?
Thanks,
John
-----Original Message-----
From: Gavin_King/[EMAIL PROTECTED]
[mailto:Gavin_King/[EMAIL PROTECTED]
Sent: Tuesday, August 13, 2002 10:42 PM
To: Urberg, John
Cc: [EMAIL PROTECTED]
Subject: Re: [Hibernate-devel] Update problems
>1) I have a class with a collection. When I load the class, hibernate
tries
>to update the foreign key on the collection table (and tries to set it to
>NULL no less). Here's the mapping:
John, I have spent a couple of hours playing around with two different
versions of Hibernate and I just can't reproduce this...
(1) Are you really, really certain you don't meddle with the collection
somewhere? On the basis of the code you presented, the lazy="true"
collection should not even be getting *initialized*, let alone removed!
(2) Could you please forward me the all the code which is needed to
reproduce this very naughty behaviour.
(3) Could you let me know which version I am meant to be testing against.
Please get back to me ASAP because this is playing on my mind....
Thanks
Gavin.
-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel