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.  [ 1 post ] 
Author Message
 Post subject: error caused by trigger
PostPosted: Thu Aug 31, 2006 7:36 pm 
Newbie

Joined: Thu Aug 31, 2006 7:30 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:? not sure what ever is with monorail

[b]Mapping documents: done by monorail

[b]Code between sessionFactory.openSession() and session.close():


Full stack trace of any exception that occurs:
SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 2). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.
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: NHibernate.HibernateException: SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 2). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HibernateException: SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 2). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.]
NHibernate.Impl.NonBatchingBatcher.AddToBatch(Int32 expectedRowCount) +141
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Object oldVersion, Object obj, SqlString sqlUpdateString, ISessionImplementor session) +1018
NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Object[] oldFields, Object oldVersion, Object obj, ISessionImplementor session) +104
NHibernate.Impl.ScheduledUpdate.Execute() +134
NHibernate.Impl.SessionImpl.Execute(IExecutable executable) +118
NHibernate.Impl.SessionImpl.ExecuteAll(IList list) +84
NHibernate.Impl.SessionImpl.Execute() +187
NHibernate.Impl.SessionImpl.Flush() +33
Castle.ActiveRecord.ActiveRecordBase.Save(Object instance) +142

[ActiveRecordException: Could not perform Save for TblSiteSection]
Castle.ActiveRecord.ActiveRecordBase.Save(Object instance) +246
Castle.ActiveRecord.ActiveRecordBase.Save() +5
cms.Controllers.SectionController.update(TblContentContainer container, TblContent content, TblSiteSection siteSection, Int32 FldSiteSectionParentID, String fldSectionsOrder, String fldContentTypes) in v:\lightmakercms\cms\controllers\organize\sectionscontroller.cs:366

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) +0
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) +320
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23
Castle.MonoRail.Framework.SmartDispatcherController.InvokeMethod(MethodInfo method, IRequest request) +52
Castle.MonoRail.Framework.Controller.InvokeMethod(MethodInfo method, Object[] methodArgs) +41
Castle.MonoRail.Framework.Controller.InternalSend(String action, Object[] actionArgs) +769

[RailsException: Unhandled Exception while rendering view]
Castle.MonoRail.Framework.Controller.InternalSend(String action, Object[] actionArgs) +1100
Castle.MonoRail.Framework.Controller.Process(IRailsEngineContext context, String areaName, String controllerName, String actionName) +399
Castle.MonoRail.Framework.MonoRailHttpHandler.Process(IRailsEngineContext context) +133
Castle.MonoRail.Framework.MonoRailHttpHandler.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


Name and version of the database you are using:
microsoft sql 2000

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

I have a trigger on the DB that is catching the update and doing a bunch of calculations and updates on other rows so its giving back a bad value.

All I want to know is there a way to tell nhibernate to ignore the error and keep going? I would like something better than just having a try catch for the error.

Thanks
Bryan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.