Nieve
unread,Dec 7, 2008, 12:00:08 PM12/7/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
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 (the latest
versions for both) 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.
It should be noted that the exception is thrown only after the
Transactions property is lazily initialised.
session management as well as transactions are being taken care of by
the spring HibernateDaoSupport class and the spring transaction
attributes respectively.
I would be grateful for any idea or response!