Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# guus81nl 9/2/2009 11:16 AM
Hey guys,

I know the trunk is still in construction, but I just want to implement some modules to save time when 2.0 is released. :)

But whenever I want to save a new section it breaks on this issue. Which surprises me, because all settings are correct.

Just wanted to know if it's a known issue.

Cheers,
Guus
NHibernate.Exceptions.GenericADOException was unhandled by user code
  Message="could not insert: [Cuyahoga.Core.Domain.Section][SQL: INSERT INTO cuyahoga_section (updatetimestamp, title, placeholder, position, cacheduration, showtitle, siteid, nodeid, moduletypeid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]"
  Source="NHibernate"
  SqlString="INSERT INTO cuyahoga_section (updatetimestamp, title, placeholder, position, cacheduration, showtitle, siteid, nodeid, moduletypeid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()"
  StackTrace:
       bij NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
       bij NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Boolean[] notNull, SqlCommandInfo sql, Object obj, ISessionImplementor session)
       bij NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Object obj, ISessionImplementor session)
       bij NHibernate.Action.EntityIdentityInsertAction.Execute()
       bij NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
       bij NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
       bij NHibernate.Event.Default.AbstractSaveEventListener.PerformSave(Object entity, Object id, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
       bij NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
       bij NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
       bij NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
       bij NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
       bij NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
       bij NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
       bij NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
       bij Castle.Facilities.NHibernateIntegration.SessionDelegate.SaveOrUpdate(Object obj)
       bij Cuyahoga.Core.DataAccess.CommonDao.SaveOrUpdateObject(Object obj) in H:\cuyahoga\Cuyahoga.Core\DataAccess\CommonDao.cs:regel 150
       bij Castle.Proxies.ICommonDaoProxya1745f159a2e49fa80b426a75b4bf521.InvocationSaveOrUpdateObject_11.InvokeMethodOnTarget()
       bij Castle.DynamicProxy.AbstractInvocation.Proceed()
       bij Castle.Facilities.AutomaticTransactionManagement.TransactionInterceptor.Intercept(IInvocation invocation)
  InnerException: System.Data.SqlClient.SqlException
       Message="Cannot insert the value NULL into column 'siteid', table 'Cuyahoga2.dbo.cuyahoga_section'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated."
       Source=".Net SqlClient Data Provider"
       ErrorCode=-2146232060
       Class=16
       LineNumber=1
       Number=515
       Procedure=""
       Server="(local)\\SQLEXPRESS"
       State=2
       StackTrace:
            bij System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
            bij System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
            bij System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
            bij System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
            bij System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
            bij System.Data.SqlClient.SqlDataReader.get_MetaData()
            bij System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
            bij System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
            bij System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
            bij System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
            bij System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
            bij System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
            bij System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
            bij NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
            bij NHibernate.Id.IdentityGenerator.InsertSelectDelegate.ExecuteAndExtract(IDbCommand insert, ISessionImplementor session)
            bij NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
       InnerException: 
# Constructor 9/2/2009 11:42 AM (edited 9/2/2009 11:46 AM)
I have found that this is a jQuery bug with IE8. (That's if this is the same issue as I have had).

If you open the 'jquery-1.3.2.min.js' file and search for the string
return N.toUpperCase()});if(L){

then insert
if(K=='NaNpx'){K=''}

before this
J[G]=K}return J[G]}

Then IE8 works fine just like FireFox and Chrome.

I believe that it is being included in the next jQuery.

I think that IE8 returns 'NaNpx' and not an empty string which causes an error.

# guus81nl 9/2/2009 12:19 PM
Hey Constructor,

Thanks for your fast reply!

I tried you solution, although I got the same error in FireFox and I don't have IE8 installed at the moment.

But you won't be surprised that it didn't work.

Any other thoughts?

Guus
# Constructor 9/2/2009 2:22 PM
I suspected not. :) Probably will be fixed when Martijn restarts work on it.

I will look later to see if it is anything simple.
# guus81nl 9/3/2009 10:24 PM
Me back! :P

Ok, I solved the problem. Turned out to be easy...:
public class SectionEdit : AdminBasePage
{
         ...
	private void btnSave_Click(object sender, EventArgs e)
	{
		if (this.IsValid)
		{
			// Remember the previous PlaceholderId and Position to detect changes
			string oldPlaceholderId = this._activeSection.PlaceholderId;
			int oldPosition = this._activeSection.Position;

			try
			{
			this._activeSection.Title = this.txtTitle.Text;
			this._activeSection.ShowTitle = this.chkShowTitle.Checked;
ln419			this._activeSection.Node = this.ActiveNode;
ln420			this._activeSection.Site = this.ActiveSite;
ln421			if (this.ActiveNode != null)
			{
			   this._activeSection.Node.Sections.Add(this._activeSection);
			}
    ...
}

You see the line this._activeSection.Site = this.ActiveSite; (420)? That one was missing. So when the INSERT was trying to insert it couldn't because it was trying to INSERT a null into a NOT NULL column.

Now it inserts Sections no problem. No one else had these problems with the trunk?

Guus
# martijnb 9/6/2009 11:31 AM
You're still using the old admin (which is going to be removed). Give the new admin a try (http://localhost:8080/manager on the VS web server).