parameter's direction doesn't match cached parameters

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
9/16/2007 5:20:06 AM
Gravatar
Total Posts 46

parameter's direction doesn't match cached parameters

I've just got the latest from SVN and I see this assertion each time I log in to the site. Any ideas? Thanks

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
parameter's direction doesn't match cached parameters

at SqlParameterHelper.DefineSqlParameter(String paramName, SqlDbType type, Int32 size, ParameterDirection dir, Object value, Boolean sizeProvided) D:\HomeDev\MojoPortal\mojoPortal.Data.MSSQL\SQLParameterHelper.cs(108)

at SqlParameterHelper.DefineSqlParameter(String paramName, SqlDbType type, Int32 size, ParameterDirection dir, Object value) D:\HomeDev\MojoPortal\mojoPortal.Data.MSSQL\SQLParameterHelper.cs(86)

at dbPortal.SiteUser_LoginByEmail(Int32 SiteID, String Email, String Password) D:\HomeDev\MojoPortal\mojoPortal.Data.MSSQL\dbPortal.cs(1776)

at SiteUser.Login(SiteSettings siteSettings, String loginString, String password) D:\HomeDev\MojoPortal\mojoPortal.Business\SiteUser.cs(1932)

at mojoMembershipProvider.ValidateUser(String userName, String password) D:\HomeDev\MojoPortal\Web\Components\mojoMembershipProvider.cs(1263)

at Login.OnAuthenticate(AuthenticateEventArgs e)

at Login.AttemptLogin()

at Login.OnBubbleEvent(Object source, EventArgs e)

at Control.RaiseBubbleEvent(Object source, EventArgs args)

at Button.OnCommand(CommandEventArgs e)

at Button.RaisePostBackEvent(String eventArgument)

at Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

at Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

at Page.RaisePostBackEvent(NameValueCollection postData)

at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at Page.ProcessRequest()

at Page.ProcessRequestWithNoAssert(HttpContext context)

at Page.ProcessRequest(HttpContext context)

at secure_login_aspx.ProcessRequest(HttpContext context) c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\ea84199f\a5695a95\App_Web_1dgt-bu7.5.cs

at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

at ApplicationStepManager.ResumeSteps(Exception error)

at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)

at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)

at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)

at HttpRuntime.ProcessRequest(HttpWorkerRequest wr)

at DecoratedWorkerRequest.ProcessRequest(Object state)

at UploadHttpModule.Application_BeginRequest(Object sender, EventArgs e)

at SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

at ApplicationStepManager.ResumeSteps(Exception error)

at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)

at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)

at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)

at HttpRuntime.ProcessRequest(HttpWorkerRequest wr)

at Request.Process()

at Host.ProcessRequest(Connection conn)


---------------------------
Abort Retry Ignore
---------------------------

9/16/2007 8:15:14 AM
Gravatar
Total Posts 18439

Re: parameter's direction doesn't match cached parameters

Hi Rob,

Some recent refactoring in the ms sql data layer introduced a new SqlParameterHelper class. In the past all the methods in dbPortal.cs had big nested if statements with different parameter assignment syntax used depending on whether parameters were cached. If cached, the parameter types are retrieved from the db instead of defined in code.

The new helper class encapsulates it and asserts whether the parameters defined in code match those retrieved from the db so it is finding bugs that previously would only have come up if caching was disabled. In this case for example the paramter was defined in code as Direction.Output but the param retrieved from the db was Direction.InputOutput. I don't think in this case it would have thrown an exception at runtime even if the caching was disabled, but the debug.asserts are failing and pointing out places where code should be corrected. In this case I'm chagning the code so it defines the param as .InputOutput

I will have this one fixed in svn trunk by end of the day. Please do let me know any others like this you encounter while debugging. A few of these have come up already, they will only come up while debugging, the release files are not affected by debug.Assert errors.

Thanks,

Joe

9/16/2007 10:59:47 AM
Gravatar
Total Posts 46

Re: parameter's direction doesn't match cached parameters

Thanks for the info Joe. I've been working the old way that's defined in the Codesmith templates. I'll bring into line the code I'm writing for the Survey module.

Cheers

Rob

9/16/2007 11:13:33 AM
Gravatar
Total Posts 18439

Re: parameter's direction doesn't match cached parameters

Cool, I'll try to update the templates this week too, so they generate code the new way. I've been meaning to do that but have got all wrapped up in making new skins. ;-)

Joe

9/18/2007 3:47:01 PM
Gravatar
Total Posts 18439

Re: parameter's direction doesn't match cached parameters

fyi, I've updated the Codesmith templates in svn trunk.

Thanks,

Joe

9/18/2007 3:49:17 PM
Gravatar
Total Posts 46

Re: parameter's direction doesn't match cached parameters

Excellent, thanks Joe. I'll give them a try.

Cheers

Rob

You must sign in to post in the forums. This thread is closed to new posts.