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.  [ 2 posts ] 
Author Message
 Post subject: List is not saving index
PostPosted: Tue Feb 26, 2008 9:39 pm 
Newbie

Joined: Thu Jan 17, 2008 1:33 pm
Posts: 6
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 1.2.1.GA

Mapping documents:
Loop.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NhibernateIndexedList"
assembly="NhibernateIndexedList">
<class name="Loop" table="Loop">
<id name="Id" column="Id" type="Int32" access="nosetter.pascalcase-m-underscore" unsaved-value="0">
<generator class="identity" />
</id>
<property name="Name" column="Name" type="string" length="50" not-null="true"/>

<list name="m_DeviceList" access="field" cascade="all">
<key column="LoopId" />
<index column="Position" />
<one-to-many class="Device" />
</list>
</class>
</hibernate-mapping>

Device.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NhibernateIndexedList"
assembly="NhibernateIndexedList">
<class name="Device" table="Device">
<id name="Id" column="Id" type="Int32" access="nosetter.pascalcase-m-underscore" unsaved-value="0">
<generator class="identity" />
</id>
<property name="Name" column="Name" type="string" length="50" not-null="true"/>
</class>
</hibernate-mapping>

Loop.cs:
public class Loop
{
private int m_Id;
private string m_Name;
private IList<Device> m_DeviceList = new List<Device>();

protected Loop()
{
}

public Loop(string name)
{
this.m_Name = name;
}

public virtual int Id
{
get { return this.m_Id; }
}

public virtual string Name
{
get { return this.m_Name; }
set { this.m_Name = value; }
}

public virtual IList<Device> DeviceList
{
get { return this.m_DeviceList; }
}

public virtual void AddDeviceToEnd(Device d)
{
if (d != null && !this.m_DeviceList.Contains(d))
{
this.m_DeviceList.Add(d);
}
}

public virtual void AddDeviceAtPostition(int position, Device d)
{
if (d != null)
{
if (this.m_DeviceList.Contains(d))
{
this.m_DeviceList.Remove(d);
}
if (position >= m_DeviceList.Count)
{
this.m_DeviceList.Add(d);
}
else
{
this.m_DeviceList.Insert(position, d);
}
}
}

public virtual void RemoveDevice(Device d)
{
if (d != null && this.m_DeviceList.Contains(d))
{
this.m_DeviceList.Remove(d);
}
}

public override string ToString()
{
string output;
output = "Loop: " + m_Name + System.Environment.NewLine;

for (int i = 0; i < m_DeviceList.Count; i++)
{
output += i.ToString() + " " + m_DeviceList[i].ToString() + System.Environment.NewLine;
}

return output;
}
}


Code between sessionFactory.openSession() and session.close():

int id;

m_Loop.AddDeviceToEnd(m_FirstDevice);

m_Session.SaveOrUpdate(m_Loop);

Console.WriteLine(m_Loop);

Assert.AreNotEqual(0, m_Loop.Id, "Id should not be zero");
id = m_Loop.Id;

m_Session.Evict(m_Loop);

Loop loop = m_Session.Get<Loop>(id);

Assert.AreEqual(1, loop.DeviceList.Count, "Loop should have 1 device");
Assert.AreEqual("First Device", loop.DeviceList[0].Name, "First Device should be in Position 1");

Full stack trace of any exception that occurs:

Name and version of the database you are using:
SQL Server 2005 Express
The generated SQL (show_sql=true):
NHibernate: INSERT INTO NHList.dbo.Loop (Name) VALUES (@p0); select SCOPE_IDENTITY(); @p0 = 'Loop1'
NHibernate: INSERT INTO NHList.dbo.Device (Name) VALUES (@p0); select SCOPE_IDENTITY(); @p0 = 'First Device'
Loop: Loop1
0 Device: First Device

NHibernate: SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ WHERE loop0_.Id=@p0; @p0 = '8'
NHibernate: SELECT m_deviceli0_.LoopId as LoopId__1_, m_deviceli0_.Id as Id1_, m_deviceli0_.Position as Position__1_, m_deviceli0_.Id as Id1_0_, m_deviceli0_.Name as Name1_0_ FROM NHList.dbo.Device m_deviceli0_ WHERE m_deviceli0_.LoopId=@p0; @p0 = '8'

Debug level Hibernate log excerpt:
20:16:38,342 INFO [TestRunnerThread] Environment: PID=960 NHibernate 1.2.1.4000 (1.2.1.4000)
20:16:38,460 INFO [TestRunnerThread] Environment: PID=960 Bytecode provider name : lcg
20:16:38,466 INFO [TestRunnerThread] Environment: PID=960 Using reflection optimizer
20:16:38,540 INFO [TestRunnerThread] Configuration: PID=960 Searching for mapped documents in assembly: NhibernateIndexedList
20:16:38,586 INFO [TestRunnerThread] Configuration: PID=960 Mapping resource: NhibernateIndexedList.Loop.hbm.xml
20:16:39,449 INFO [TestRunnerThread] Dialect: PID=960 Using dialect: NHibernate.Dialect.MsSql2005Dialect
20:16:39,564 INFO [TestRunnerThread] HbmBinder: PID=960 Mapping class: NhibernateIndexedList.Loop -> Loop
20:16:39,611 DEBUG [TestRunnerThread] HbmBinder: PID=960 Mapped property: Id -> Id, type: Int32
20:16:39,636 DEBUG [TestRunnerThread] HbmBinder: PID=960 Mapped property: Name -> Name, type: String
20:16:39,683 DEBUG [TestRunnerThread] HbmBinder: PID=960 Mapped property: m_DeviceList, type: IList`1
20:16:39,688 INFO [TestRunnerThread] Configuration: PID=960 Mapping resource: NhibernateIndexedList.Device.hbm.xml
20:16:39,696 INFO [TestRunnerThread] Dialect: PID=960 Using dialect: NHibernate.Dialect.MsSql2005Dialect
20:16:39,720 INFO [TestRunnerThread] HbmBinder: PID=960 Mapping class: NhibernateIndexedList.Device -> Device
20:16:39,731 DEBUG [TestRunnerThread] HbmBinder: PID=960 Mapped property: Id -> Id, type: Int32
20:16:39,739 DEBUG [TestRunnerThread] HbmBinder: PID=960 Mapped property: Name -> Name, type: String
20:16:39,756 INFO [TestRunnerThread] Configuration: PID=960 checking mappings queue
20:16:39,756 INFO [TestRunnerThread] Configuration: PID=960 processing one-to-many association mappings
20:16:39,787 DEBUG [TestRunnerThread] CollectionSecondPass: PID=960 Second pass for collection: NhibernateIndexedList.Loop.m_DeviceList
20:16:39,805 INFO [TestRunnerThread] HbmBinder: PID=960 mapping collection: NhibernateIndexedList.Loop.m_DeviceList -> Device
20:16:39,822 DEBUG [TestRunnerThread] CollectionSecondPass: PID=960 Mapped collection key: LoopId, index: Position, one-to-many: Device
20:16:39,834 INFO [TestRunnerThread] Configuration: PID=960 processing one-to-one association property references
20:16:39,848 INFO [TestRunnerThread] Configuration: PID=960 processing foreign key constraints
20:16:39,863 DEBUG [TestRunnerThread] Configuration: PID=960 resolving reference to class: Loop
20:16:39,895 INFO [TestRunnerThread] Dialect: PID=960 Using dialect: NHibernate.Dialect.MsSql2005Dialect
20:16:39,913 INFO [TestRunnerThread] ConnectionProviderFactory: PID=960 Initializing connection provider: NHibernate.Connection.DriverConnectionProvider
20:16:39,926 INFO [TestRunnerThread] ConnectionProvider: PID=960 Configuring ConnectionProvider
20:16:39,943 INFO [TestRunnerThread] SettingsFactory: PID=960 Transaction factory: NHibernate.Transaction.AdoNetTransactionFactory
20:16:39,956 INFO [TestRunnerThread] SettingsFactory: PID=960 Optimize cache for minimal puts: False
20:16:39,958 INFO [TestRunnerThread] SettingsFactory: PID=960 Connection release mode: auto
20:16:39,958 INFO [TestRunnerThread] SettingsFactory: PID=960 Default schema set to: NHList.dbo
20:16:39,995 INFO [TestRunnerThread] SettingsFactory: PID=960 echoing all SQL to stdout
20:16:40,013 INFO [TestRunnerThread] SettingsFactory: PID=960 Query translator: NHibernate.Hql.Classic.ClassicQueryTranslatorFactory
20:16:40,025 INFO [TestRunnerThread] SettingsFactory: PID=960 Query language substitutions: {}
20:16:40,040 INFO [TestRunnerThread] SettingsFactory: PID=960 cache provider: NHibernate.Cache.NoCacheProvider, NHibernate, Version=1.2.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
20:16:40,053 INFO [TestRunnerThread] SettingsFactory: PID=960 Using Isolation Level: ReadCommitted
20:16:40,083 INFO [TestRunnerThread] SessionFactoryImpl: PID=960 building session factory
20:16:40,098 DEBUG [TestRunnerThread] SessionFactoryImpl: PID=960 instantiating session factory with properties: {hibernate.connection.provider=NHibernate.Connection.DriverConnectionProvider, hibernate.connection.connection_string=Data Source=localhost\SQLEXPRESS;Initial Catalog=SingletonTest;Integrated Security=True, hibernate.connection.driver_class=NHibernate.Driver.SqlClientDriver, hibernate.show_sql=true, hibernate.use_reflection_optimizer=true, hibernate.default_schema=NHList.dbo, hibernate.connection.isolation=ReadCommitted, hibernate.dialect=NHibernate.Dialect.MsSql2005Dialect}
20:16:40,333 DEBUG [TestRunnerThread] SessionFactoryObjectFactory: PID=960 initializing class SessionFactoryObjectFactory
20:16:40,342 DEBUG [TestRunnerThread] SessionFactoryObjectFactory: PID=960 registered: 566ec28d1df3434e9934f6964e2e3231(unnamed)
20:16:40,354 INFO [TestRunnerThread] SessionFactoryObjectFactory: PID=960 no name configured
20:16:40,447 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Device: SELECT device0_.Id as Id1_0_, device0_.Name as Name1_0_ FROM NHList.dbo.Device device0_ WHERE device0_.Id=?
20:16:40,457 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Device: SELECT device0_.Id as Id1_0_, device0_.Name as Name1_0_ FROM NHList.dbo.Device device0_ WHERE device0_.Id=?
20:16:40,473 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Device: SELECT device0_.Id as Id1_0_, device0_.Name as Name1_0_ FROM NHList.dbo.Device device0_ with (updlock, rowlock) WHERE device0_.Id=?
20:16:40,479 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Device: SELECT device0_.Id as Id1_0_, device0_.Name as Name1_0_ FROM NHList.dbo.Device device0_ with (updlock, rowlock) WHERE device0_.Id=?
20:16:40,501 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Loop: SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ WHERE loop0_.Id=?
20:16:40,507 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Loop: SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ WHERE loop0_.Id=?
20:16:40,524 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Loop: SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ with (updlock, rowlock) WHERE loop0_.Id=?
20:16:40,538 DEBUG [TestRunnerThread] AbstractEntityLoader: PID=960 Static select for entity NhibernateIndexedList.Loop: SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ with (updlock, rowlock) WHERE loop0_.Id=?
20:16:40,568 DEBUG [TestRunnerThread] OneToManyLoader: PID=960 Static select for one-to-many NhibernateIndexedList.Loop.m_DeviceList: SELECT m_deviceli0_.LoopId as LoopId__1_, m_deviceli0_.Id as Id1_, m_deviceli0_.Position as Position__1_, m_deviceli0_.Id as Id1_0_, m_deviceli0_.Name as Name1_0_ FROM NHList.dbo.Device m_deviceli0_ WHERE m_deviceli0_.LoopId=?
20:16:40,579 DEBUG [TestRunnerThread] SessionFactoryImpl: PID=960 Instantiated session factory
20:16:40,609 DEBUG [TestRunnerThread] SessionImpl: PID=960 opened session
20:16:40,630 DEBUG [TestRunnerThread] SessionImpl: PID=960 opened session
20:16:40,649 DEBUG [TestRunnerThread] Cascades: PID=960 unsaved-value: 0
20:16:40,660 DEBUG [TestRunnerThread] SessionImpl: PID=960 SaveOrUpdate() unsaved instance
20:16:40,682 DEBUG [TestRunnerThread] SessionImpl: PID=960 saving [NhibernateIndexedList.Loop#<null>]
20:16:40,699 DEBUG [TestRunnerThread] Cascades: PID=960 processing cascades for: NhibernateIndexedList.Loop
20:16:40,707 DEBUG [TestRunnerThread] Cascades: PID=960 done processing cascades for: NhibernateIndexedList.Loop
20:16:40,718 DEBUG [TestRunnerThread] SessionImpl: PID=960 executing insertions
20:16:40,750 DEBUG [TestRunnerThread] WrapVisitor: PID=960 Wrapped collection in role: NhibernateIndexedList.Loop.m_DeviceList
20:16:40,772 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Inserting entity: NhibernateIndexedList.Loop (native id)
20:16:40,826 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened new IDbCommand, open IDbCommands: 1
20:16:40,838 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Building an IDbCommand object for the SqlString: INSERT INTO NHList.dbo.Loop (Name) VALUES (?); select SCOPE_IDENTITY()
20:16:40,857 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Dehydrating entity: [NhibernateIndexedList.Loop#<null>]
20:16:40,869 DEBUG [TestRunnerThread] StringType: PID=960 binding 'Loop1' to parameter: 0
20:16:40,888 DEBUG [TestRunnerThread] SQL: PID=960 INSERT INTO NHList.dbo.Loop (Name) VALUES (@p0); select SCOPE_IDENTITY(); @p0 = 'Loop1'
20:16:40,908 DEBUG [TestRunnerThread] DriverConnectionProvider: PID=960 Obtaining IDbConnection from Driver
20:16:41,287 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened IDataReader, open IDataReaders: 1
20:16:41,318 DEBUG [TestRunnerThread] Int32Type: PID=960 returning '8' as column:
20:16:41,337 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Natively generated identity: 8
20:16:41,338 DEBUG [TestRunnerThread] NHybridDataReader: PID=960 running NHybridDataReader.Dispose()
20:16:41,362 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDataReader, open IDataReaders :0
20:16:41,372 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDbCommand, open IDbCommands: 0
20:16:41,392 DEBUG [TestRunnerThread] ConnectionManager: PID=960 aggressively releasing database connection
20:16:41,401 DEBUG [TestRunnerThread] ConnectionProvider: PID=960 Closing connection
20:16:41,440 DEBUG [TestRunnerThread] Cascades: PID=960 processing cascades for: NhibernateIndexedList.Loop
20:16:41,451 DEBUG [TestRunnerThread] Cascades: PID=960 cascading to collection: NhibernateIndexedList.Loop.m_DeviceList
20:16:41,468 DEBUG [TestRunnerThread] Cascades: PID=960 cascading to SaveOrUpdate()
20:16:41,479 DEBUG [TestRunnerThread] Cascades: PID=960 unsaved-value: 0
20:16:41,493 DEBUG [TestRunnerThread] SessionImpl: PID=960 SaveOrUpdate() unsaved instance
20:16:41,503 DEBUG [TestRunnerThread] SessionImpl: PID=960 saving [NhibernateIndexedList.Device#<null>]
20:16:41,516 DEBUG [TestRunnerThread] SessionImpl: PID=960 executing insertions
20:16:41,530 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Inserting entity: NhibernateIndexedList.Device (native id)
20:16:41,540 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened new IDbCommand, open IDbCommands: 1
20:16:41,553 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Building an IDbCommand object for the SqlString: INSERT INTO NHList.dbo.Device (Name) VALUES (?); select SCOPE_IDENTITY()
20:16:41,567 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Dehydrating entity: [NhibernateIndexedList.Device#<null>]
20:16:41,579 DEBUG [TestRunnerThread] StringType: PID=960 binding 'First Device' to parameter: 0
20:16:41,588 DEBUG [TestRunnerThread] SQL: PID=960 INSERT INTO NHList.dbo.Device (Name) VALUES (@p0); select SCOPE_IDENTITY(); @p0 = 'First Device'
20:16:41,608 DEBUG [TestRunnerThread] DriverConnectionProvider: PID=960 Obtaining IDbConnection from Driver
20:16:41,646 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened IDataReader, open IDataReaders: 1
20:16:41,657 DEBUG [TestRunnerThread] Int32Type: PID=960 returning '5' as column:
20:16:41,669 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Natively generated identity: 5
20:16:41,669 DEBUG [TestRunnerThread] NHybridDataReader: PID=960 running NHybridDataReader.Dispose()
20:16:41,699 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDataReader, open IDataReaders :0
20:16:41,713 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDbCommand, open IDbCommands: 0
20:16:41,728 DEBUG [TestRunnerThread] ConnectionManager: PID=960 aggressively releasing database connection
20:16:41,739 DEBUG [TestRunnerThread] ConnectionProvider: PID=960 Closing connection
20:16:41,756 DEBUG [TestRunnerThread] Cascades: PID=960 done processing cascades for: NhibernateIndexedList.Loop
20:16:41,801 DEBUG [TestRunnerThread] SessionImpl: PID=960 evicting [NhibernateIndexedList.Loop]
20:16:41,810 DEBUG [TestRunnerThread] SessionImpl: PID=960 evicting collection: [<unreferenced>]
20:16:41,825 DEBUG [TestRunnerThread] Cascades: PID=960 processing cascades for: NhibernateIndexedList.Loop
20:16:41,837 DEBUG [TestRunnerThread] Cascades: PID=960 cascading to collection: NhibernateIndexedList.Loop.m_DeviceList
20:16:41,851 DEBUG [TestRunnerThread] Cascades: PID=960 cascading to evict()
20:16:41,866 DEBUG [TestRunnerThread] SessionImpl: PID=960 evicting [NhibernateIndexedList.Device]
20:16:41,875 DEBUG [TestRunnerThread] Cascades: PID=960 done processing cascades for: NhibernateIndexedList.Loop
20:16:41,880 DEBUG [TestRunnerThread] SessionImpl: PID=960 loading [Loop#8]
20:16:41,910 DEBUG [TestRunnerThread] SessionImpl: PID=960 attempting to resolve [Loop#8]
20:16:41,923 DEBUG [TestRunnerThread] SessionImpl: PID=960 object not resolved in any cache [NhibernateIndexedList.Loop#8]
20:16:41,936 DEBUG [TestRunnerThread] AbstractEntityPersister: PID=960 Fetching entity: [NhibernateIndexedList.Loop#8]
20:16:41,957 DEBUG [TestRunnerThread] Loader: PID=960 loading entity: [NhibernateIndexedList.Loop#8]
20:16:41,984 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened new IDbCommand, open IDbCommands: 1
20:16:41,996 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Building an IDbCommand object for the SqlString: SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ WHERE loop0_.Id=?
20:16:42,007 DEBUG [TestRunnerThread] Int32Type: PID=960 binding '8' to parameter: 0
20:16:42,025 INFO [TestRunnerThread] Loader: PID=960 SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ WHERE loop0_.Id=@p0
20:16:42,036 DEBUG [TestRunnerThread] SQL: PID=960 SELECT loop0_.Id as Id0_0_, loop0_.Name as Name0_0_ FROM NHList.dbo.Loop loop0_ WHERE loop0_.Id=@p0; @p0 = '8'
20:16:42,053 DEBUG [TestRunnerThread] DriverConnectionProvider: PID=960 Obtaining IDbConnection from Driver
20:16:42,063 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened IDataReader, open IDataReaders: 1
20:16:42,084 DEBUG [TestRunnerThread] Loader: PID=960 processing result set
20:16:42,101 DEBUG [TestRunnerThread] Loader: PID=960 result set row: 0
20:16:42,115 DEBUG [TestRunnerThread] Loader: PID=960 result row: 8
20:16:42,134 DEBUG [TestRunnerThread] Loader: PID=960 Initializing object from DataReader: [NhibernateIndexedList.Loop#8]
20:16:42,146 DEBUG [TestRunnerThread] Loader: PID=960 Hydrating entity: NhibernateIndexedList.Loop#8
20:16:42,166 DEBUG [TestRunnerThread] StringType: PID=960 returning 'Loop1' as column: Name0_0_
20:16:42,168 DEBUG [TestRunnerThread] Loader: PID=960 done processing result set (1 rows)
20:16:42,191 DEBUG [TestRunnerThread] NHybridDataReader: PID=960 running NHybridDataReader.Dispose()
20:16:42,194 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDataReader, open IDataReaders :0
20:16:42,219 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDbCommand, open IDbCommands: 0
20:16:42,231 DEBUG [TestRunnerThread] ConnectionManager: PID=960 aggressively releasing database connection
20:16:42,244 DEBUG [TestRunnerThread] ConnectionProvider: PID=960 Closing connection
20:16:42,256 DEBUG [TestRunnerThread] Loader: PID=960 total objects hydrated: 1
20:16:42,269 DEBUG [TestRunnerThread] SessionImpl: PID=960 resolving associations for: [NhibernateIndexedList.Loop#8]
20:16:42,284 DEBUG [TestRunnerThread] SessionImpl: PID=960 creating collection wrapper:[NhibernateIndexedList.Loop.m_DeviceList#8]
20:16:42,296 DEBUG [TestRunnerThread] SessionImpl: PID=960 done materializing entity [NhibernateIndexedList.Loop#8]
20:16:42,306 DEBUG [TestRunnerThread] SessionImpl: PID=960 initializing non-lazy collections
20:16:42,314 DEBUG [TestRunnerThread] Loader: PID=960 done entity load
20:16:42,314 DEBUG [TestRunnerThread] ConnectionManager: PID=960 after autocommit
20:16:42,316 DEBUG [TestRunnerThread] ConnectionManager: PID=960 aggressively releasing database connection
20:16:42,357 DEBUG [TestRunnerThread] SessionImpl: PID=960 transaction completion
20:16:42,376 DEBUG [TestRunnerThread] SessionImpl: PID=960 initializing collection [NhibernateIndexedList.Loop.m_DeviceList#8]
20:16:42,386 DEBUG [TestRunnerThread] SessionImpl: PID=960 checking second-level cache
20:16:42,400 DEBUG [TestRunnerThread] SessionImpl: PID=960 collection not cached
20:16:42,418 DEBUG [TestRunnerThread] Loader: PID=960 loading collection: [NhibernateIndexedList.Loop.m_DeviceList#8]
20:16:42,428 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened new IDbCommand, open IDbCommands: 1
20:16:42,430 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Building an IDbCommand object for the SqlString: SELECT m_deviceli0_.LoopId as LoopId__1_, m_deviceli0_.Id as Id1_, m_deviceli0_.Position as Position__1_, m_deviceli0_.Id as Id1_0_, m_deviceli0_.Name as Name1_0_ FROM NHList.dbo.Device m_deviceli0_ WHERE m_deviceli0_.LoopId=?
20:16:42,431 DEBUG [TestRunnerThread] Int32Type: PID=960 binding '8' to parameter: 0
20:16:42,465 INFO [TestRunnerThread] Loader: PID=960 SELECT m_deviceli0_.LoopId as LoopId__1_, m_deviceli0_.Id as Id1_, m_deviceli0_.Position as Position__1_, m_deviceli0_.Id as Id1_0_, m_deviceli0_.Name as Name1_0_ FROM NHList.dbo.Device m_deviceli0_ WHERE m_deviceli0_.LoopId=@p0
20:16:42,478 DEBUG [TestRunnerThread] SQL: PID=960 SELECT m_deviceli0_.LoopId as LoopId__1_, m_deviceli0_.Id as Id1_, m_deviceli0_.Position as Position__1_, m_deviceli0_.Id as Id1_0_, m_deviceli0_.Name as Name1_0_ FROM NHList.dbo.Device m_deviceli0_ WHERE m_deviceli0_.LoopId=@p0; @p0 = '8'
20:16:42,496 DEBUG [TestRunnerThread] DriverConnectionProvider: PID=960 Obtaining IDbConnection from Driver
20:16:42,518 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Opened IDataReader, open IDataReaders: 1
20:16:42,530 DEBUG [TestRunnerThread] Loader: PID=960 result set contains (possibly empty) collection: [NhibernateIndexedList.Loop.m_DeviceList#8]
20:16:42,534 DEBUG [TestRunnerThread] SessionImpl: PID=960 uninitialized collection: initializing
20:16:42,552 DEBUG [TestRunnerThread] Loader: PID=960 processing result set
20:16:42,570 DEBUG [TestRunnerThread] Loader: PID=960 done processing result set (0 rows)
20:16:42,582 DEBUG [TestRunnerThread] NHybridDataReader: PID=960 running NHybridDataReader.Dispose()
20:16:42,598 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDataReader, open IDataReaders :0
20:16:42,612 DEBUG [TestRunnerThread] BatcherImpl: PID=960 Closed IDbCommand, open IDbCommands: 0
20:16:42,624 DEBUG [TestRunnerThread] ConnectionManager: PID=960 aggressively releasing database connection
20:16:42,633 DEBUG [TestRunnerThread] ConnectionProvider: PID=960 Closing connection
20:16:42,634 DEBUG [TestRunnerThread] Loader: PID=960 total objects hydrated: 0
20:16:42,664 DEBUG [TestRunnerThread] SessionImpl: PID=960 1 collections were found in result set
20:16:42,679 DEBUG [TestRunnerThread] SessionImpl: PID=960 collection fully initialized: [NhibernateIndexedList.Loop.m_DeviceList#8]
20:16:42,690 DEBUG [TestRunnerThread] SessionImpl: PID=960 1 collections initialized
20:16:42,701 DEBUG [TestRunnerThread] SessionImpl: PID=960 initializing non-lazy collections
20:16:42,710 DEBUG [TestRunnerThread] Loader: PID=960 done loading collection
20:16:42,729 DEBUG [TestRunnerThread] SessionImpl: PID=960 collection initialized
20:16:42,756 DEBUG [TestRunnerThread] SessionImpl: PID=960 closing session
20:16:42,756 DEBUG [TestRunnerThread] BatcherImpl: PID=960 running BatcherImpl.Dispose(true)
20:16:42,780 DEBUG [TestRunnerThread] AdoTransaction: PID=960 running AdoTransaction.Dispose()

Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 09, 2008 3:55 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Have you solved your problem ? For me it looks like the position is not part of the childs mapping, so it will not be saved.

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.