hello.
i did try that, but still no luck. it really looks like during the "1st pass" nhibernate will only persist the values of the movimento element and won't do anything to component collection maintained on the bag. then, when it flushes the session, it somwhoe sees that there's one element on the collection and it just persists it by creating a new connection and executing the command (at least, this is what i think it's doing).
can someone help me understand the log of operations executed by nhibernate (maybe i'm seeing it incorrectly). btw, i'm not sure if waht i need is supported for collection of components or if it'll only work for collection of elements:
2007-09-19 11:58:03,848 [1] DEBUG NHibernate.Engine.Cascades - unsaved-value: 0
2007-09-19 11:58:03,868 [1] DEBUG NHibernate.Impl.SessionImpl - SaveOrUpdate() unsaved instance
2007-09-19 11:58:03,875 [1] DEBUG NHibernate.Impl.SessionImpl - saving [SRA.MercadosOO.Movimento#<null>]
2007-09-19 11:58:03,881 [1] DEBUG NHibernate.Engine.Cascades - processing cascades for: SRA.MercadosOO.Movimento
2007-09-19 11:58:03,884 [1] DEBUG NHibernate.Engine.Cascades - done processing cascades for: SRA.MercadosOO.Movimento
2007-09-19 11:58:03,885 [1] DEBUG NHibernate.Impl.SessionImpl - executing insertions
2007-09-19 11:58:03,889 [1] DEBUG NHibernate.Engine.Cascades - unsaved-value: 0
2007-09-19 11:58:03,890 [1] DEBUG NHibernate.Engine.Versioning - Seeding: 1
2007-09-19 11:58:03,912 [1] DEBUG NHibernate.Impl.WrapVisitor - Wrapped collection in role: SRA.MercadosOO.Movimento.Celulas
2007-09-19 11:58:03,922 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Inserting entity: SRA.MercadosOO.Movimento (native id)
2007-09-19 11:58:03,922 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Version: 1
2007-09-19 11:58:03,960 [1] DEBUG NHibernate.Impl.BatcherImpl - Opened new IDbCommand, open IDbCommands: 1
2007-09-19 11:58:03,960 [1] DEBUG NHibernate.Impl.BatcherImpl - Building an IDbCommand object for the SqlString: INSERT INTO dbo.Movimento (Version, DataEntrada, DataSaida, Peso, IdLote, TotalDiasAnterior, Estado, TipoTaxaInicial) VALUES (?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()
2007-09-19 11:58:03,961 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Dehydrating entity: [SRA.MercadosOO.Movimento#<null>]
2007-09-19 11:58:04,078 [1] DEBUG NHibernate.Impl.BatcherImpl - Opened IDataReader, open IDataReaders: 1
2007-09-19 11:58:04,160 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Natively generated identity: 105
2007-09-19 11:58:04,161 [1] DEBUG NHibernate.Driver.NHybridDataReader - running NHybridDataReader.Dispose()
2007-09-19 11:58:04,162 [1] DEBUG NHibernate.Impl.BatcherImpl - Closed IDataReader, open IDataReaders :0
2007-09-19 11:58:04,164 [1] DEBUG NHibernate.Impl.BatcherImpl - Closed IDbCommand, open IDbCommands: 0
2007-09-19 11:58:04,170 [1] DEBUG NHibernate.Engine.Cascades - processing cascades for: SRA.MercadosOO.Movimento
2007-09-19 11:58:04,172 [1] DEBUG NHibernate.Engine.Cascades - cascading to collection: SRA.MercadosOO.Movimento.Celulas
2007-09-19 11:58:04,176 [1] DEBUG NHibernate.Engine.Cascades - done processing cascades for: SRA.MercadosOO.Movimento
2007-09-19 11:58:04,201 [1] DEBUG NHibernate.Transaction.AdoTransaction - rollback
2007-09-19 11:58:04,207 [1] DEBUG NHibernate.Transaction.AdoTransaction - running AdoTransaction.Dispose()
2007-09-19 11:58:04,211 [1] DEBUG NHibernate.Impl.ConnectionManager - aggressively releasing database connection
2007-09-19 11:58:04,212 [1] DEBUG NHibernate.Connection.ConnectionProvider - Closing connection
2007-09-19 11:58:04,224 [1] DEBUG NHibernate.Impl.SessionImpl - transaction completion
2007-09-19 11:58:04,230 [1] DEBUG NHibernate.Impl.SessionImpl - flushing session
2007-09-19 11:58:04,232 [1] DEBUG NHibernate.Engine.Cascades - processing cascades for: SRA.MercadosOO.Movimento
2007-09-19 11:58:04,232 [1] DEBUG NHibernate.Engine.Cascades - cascading to collection: SRA.MercadosOO.Movimento.Celulas
2007-09-19 11:58:04,232 [1] DEBUG NHibernate.Engine.Cascades - done processing cascades for: SRA.MercadosOO.Movimento
2007-09-19 11:58:04,235 [1] DEBUG NHibernate.Impl.SessionImpl - Flushing entities and processing referenced collections
2007-09-19 11:58:04,248 [1] DEBUG NHibernate.Impl.AbstractVisitor - Processing collection for role SRA.MercadosOO.Movimento.Celulas
2007-09-19 11:58:04,251 [1] DEBUG NHibernate.Impl.SessionImpl - Collection found: [SRA.MercadosOO.Movimento.Celulas#105], was: [<unreferenced>]
2007-09-19 11:58:04,255 [1] DEBUG NHibernate.Impl.SessionImpl - Processing unreferenced collections
2007-09-19 11:58:04,255 [1] DEBUG NHibernate.Impl.SessionImpl - scheduling collection removes/(re)creates/updates
2007-09-19 11:58:04,255 [1] DEBUG NHibernate.Impl.SessionImpl - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
2007-09-19 11:58:04,255 [1] DEBUG NHibernate.Impl.SessionImpl - Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
2007-09-19 11:58:04,257 [1] DEBUG NHibernate.Impl.Printer - listing entities:
2007-09-19 11:58:04,266 [1] DEBUG NHibernate.Impl.Printer - SRA.MercadosOO.Movimento{Celulas=[CelulaMercado{Piso=1, IdCamara=1, Fila=1, Celula=1}], Estado=1, TipoTaxaInicial=0, DataSaida=null, Version=1, DataEntrada=19-09-2007, Id=105, IdLote=1, TotalDias=10, Peso=10}
2007-09-19 11:58:04,266 [1] DEBUG NHibernate.Impl.SessionImpl - executing flush
2007-09-19 11:58:04,266 [1] DEBUG NHibernate.Impl.ConnectionManager - registering flush begin
2007-09-19 11:58:04,271 [1] DEBUG NHibernate.Persister.Collection.ICollectionPersister - Inserting collection: [SRA.MercadosOO.Movimento.Celulas#105]
2007-09-19 11:58:04,274 [1] DEBUG NHibernate.Impl.BatcherImpl - Opened new IDbCommand, open IDbCommands: 1
2007-09-19 11:58:04,275 [1] DEBUG NHibernate.Impl.BatcherImpl - Building an IDbCommand object for the SqlString: INSERT INTO dbo.MovimentoCelula (IdMovimento, IdCamara, Celula, Fila, Piso) VALUES (?, ?, ?, ?, ?)
2007-09-19 11:58:04,278 [1] DEBUG NHibernate.Connection.DriverConnectionProvider - Obtaining IDbConnection from Driver
2007-09-19 11:58:04,293 [1] DEBUG NHibernate.Persister.Collection.ICollectionPersister - done inserting collection: 1 rows inserted
2007-09-19 11:58:04,299 [1] DEBUG NHibernate.Impl.BatcherImpl - Closed IDbCommand, open IDbCommands: 0
2007-09-19 11:58:04,300 [1] DEBUG NHibernate.Impl.ConnectionManager - skipping aggressive-release due to flush cycle
2007-09-19 11:58:04,300 [1] DEBUG NHibernate.Impl.ConnectionManager - registering flush end
2007-09-19 11:58:04,300 [1] DEBUG NHibernate.Impl.ConnectionManager - aggressively releasing database connection
2007-09-19 11:58:04,300 [1] DEBUG NHibernate.Connection.ConnectionProvider - Closing connection
2007-09-19 11:58:04,302 [1] DEBUG NHibernate.Impl.SessionImpl - post flush
2007-09-19 11:58:04,304 [1] DEBUG NHibernate.Impl.SessionImpl - closing session
2007-09-19 11:58:04,304 [1] DEBUG NHibernate.Impl.BatcherImpl - running BatcherImpl.Dispose(true)
2007-09-19 11:58:04,306 [1] DEBUG NHibernate.Transaction.AdoTransaction - running AdoTransaction.Dispose()
|