-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: <composite-element> collections are read-only?
PostPosted: Fri Oct 28, 2005 8:48 pm 
Beginner
Beginner

Joined: Thu May 26, 2005 1:00 pm
Posts: 29
I've been experimenting more with composite-element, and it seems the a composite-element collection is read-only. Everytime I try to add something to the IList I receive a NotSupportException:
Code:
[NotSupportedException: Collection is read-only.]
   System.Collections.ReadOnlyList.Add(Object obj) +48
   SpringAir.SpecAndQuote.Product.ControlPanel.cmdExSupInclude_Click(Object sender, EventArgs e) in C:\Documents and Settings\Sandro\My Documents\SpringAirRepo\SpecAndQuote\trunk\Product\ProductType\ControlPanel\Controller.cs:728
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1281

Is this intentional? Are the composite-element collections intended to be replaced entirely instead of being added to? ie.
Code:
IList l = new ArrayList(oldList);
l.Add(item);
obj.list = l;
//... instead of
obj.list.Add(item);


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 6:34 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I think the problem is somewhere in your code, NHibernate doesn't use read-only collections.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 31, 2005 10:55 am 
Beginner
Beginner

Joined: Thu May 26, 2005 1:00 pm
Posts: 29
Crap, you're right. Thanks! :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.