Projects >> Vireo >>219b224997160a8c5ea8edf3604bafa71bd0e9c8

Chunk
Conflicting content
	 *            The attachment to remove.
	 */
	protected void removeAttachment(Attachment attachment) {
<<<<<<< HEAD
		
		// There is a problem with HashSet and JPA. Items are hashed based upon
		// their id, but the id can change. Originally it is null until it is
		// saved, and after that it's the unique id from the database. However
		// if you try and remove the new object after it has been saved while
		// still on the original instance of the parent object the remove will
		// silently fail because the hashcode of the object has changed. To
		// solve this problem we rehash the set just before moving. This is a
		// database expensive operation.
		attachments = new HashSet(attachments);
=======
>>>>>>> e832660e48dacff70218a7e16cde2fa239059e88
		attachments.remove(attachment);
	}
Solution content
	 *            The attachment to remove.
	 */
	protected void removeAttachment(Attachment attachment) {		
		// There is a problem with HashSet and JPA. Items are hashed based upon
		// their id, but the id can change. Originally it is null until it is
		// saved, and after that it's the unique id from the database. However
		// if you try and remove the new object after it has been saved while
		// still on the original instance of the parent object the remove will
		// silently fail because the hashcode of the object has changed. To
		// solve this problem we rehash the set just before moving. This is a
		// database expensive operation.
		attachments = new HashSet(attachments);
		attachments.remove(attachment);
	}
File
JpaSubmissionImpl.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Method invocation