Hi,
Does anyone know why the following is occuring?
1)
I'm using criteria to get a list of objects out of my database for reading purposes only. At the moment I am not doing anything with the returned list from criteria.List(). Yet when I commit the transaction (I'm using the open session per view pattern) nhibernate is performing a batch update. I don't understand why since nothing at all has changed. The criteria.List() operation is the only operation I am performing in this transaction.
2)
When nhibernate does this batch update I am getting an error to do with dates. The object has a valid System.DateTime value set (Note: I did not set this it was set by nhibernate when it was pulled from the database). Yet I get the following:
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
Source Error:
Line 91: Catch ex As HibernateException
Line 92: RollbackTransaction()
Line 93: Throw ex
Line 94: End Try
Line 95:
Source File: C:\projects\EventHorizon\DATAACCESSCORE\NHibernateSessionManager.vb Line: 93
Stack Trace:
[SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
NHibernate.Impl.BatcherImpl.ExecuteNonQuery(IDbCommand cmd)
NHibernate.Impl.NonBatchingBatcher.AddToBatch(Int32 expectedRowCount)
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Object oldVersion, Object obj, SqlString sqlUpdateString, ISessionImplementor session)
[ADOException: could not update: [EHClasses.Modules.IA.Model.EstateItem#1437]]
EHClasses.DataAccessCore.NHibernateSessionManager.CommitTransaction() in C:\projects\EventHorizon\DATAACCESSCORE\NHibernateSessionManager.vb:93
EHClasses.DataAccessCore.NHibernateSessionModule.CommitAndCloseSession(Object sender, EventArgs e) in C:\projects\EventHorizon\DATAACCESSCORE\NHibernateSessionModule.vb:22
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
|