Illegal attempt to associate a collection with two open sessions

"Nieve Goor" <[email protected]> Sun, 7 Dec 2008 16:21:07 +0100
Newsgroups gmane.comp.windows.dotnet.nhibernate.devel
Message-ID <[email protected]>
--===============1239350820021123415==
Content-Type: multipart/alternative; 
	boundary="----=_Part_8478_117803.1228663267507"

------=_Part_8478_117803.1228663267507
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello all,
new to the list, hope I'll be able to contribute as well :)
Before I begin, here's a bit of background: I'm working on a library
cataloguing application using NHibernate + Spring.Net strictly for
educational reasons...

The exception I've mentioned is thrown whenever attempting to do a
session.SaveOrUpdate() on an object (library Item) containing a many-to-many
property (IList<LibTransaction> Transactions). The mapping (using
NHibernate.Mapping.Attributes) looks like this:

[Bag(0, Access = "property", Lazy = true, Inverse = true, Name =
"Transactions", Table = "ItemTransaction")]
[Key(1, Column = "ItemID")]
[ManyToMany(2, ClassType = typeof(LibTransaction), Column =
"TransactionID")]
public virtual IList<LibTransaction> Transactions
{
    get { return transactions; }
    set { transactions = value; }
}

The exception is also thrown whenever attempting
IPersistentCollection.SetCurrentSession() with the above mentioned property.

I would be grateful for any idea or response!

------=_Part_8478_117803.1228663267507
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello all,<br>new to the list, hope I&#39;ll be able to contribute as well :)<br>Before I begin, here&#39;s a bit of background: I&#39;m working on a library cataloguing application using NHibernate + Spring.Net strictly for educational reasons...<br>
<br>The exception I&#39;ve mentioned is thrown whenever attempting to do a session.SaveOrUpdate() on an object (library Item) containing a many-to-many property (IList&lt;LibTransaction&gt; Transactions). The mapping (using NHibernate.Mapping.Attributes) looks like this:<br>
<br>[Bag(0, Access = &quot;property&quot;, Lazy = true, Inverse = true, Name = &quot;Transactions&quot;, Table = &quot;ItemTransaction&quot;)]<br>[Key(1, Column = &quot;ItemID&quot;)]<br>[ManyToMany(2, ClassType = typeof(LibTransaction), Column = &quot;TransactionID&quot;)]<br>
public virtual IList&lt;LibTransaction&gt; Transactions<br>{<br>&nbsp;&nbsp;&nbsp; get { return transactions; }<br>&nbsp;&nbsp;&nbsp; set { transactions = value; }<br>}<br><br>The exception is also thrown whenever attempting IPersistentCollection.SetCurrentSession() with the above mentioned property.<br>
<br>I would be grateful for any idea or response!<br>

------=_Part_8478_117803.1228663267507--


--===============1239350820021123415==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
--===============1239350820021123415==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Nhibernate-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development

--===============1239350820021123415==--