Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4022010
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:25:19+00:00 2026-05-20T10:25:19+00:00

I have an application which models the electrical distribution of a system whereby if

  • 0

I have an application which models the electrical distribution of a system whereby if certain of the components fail the routing is automatically rerouted. I’ve modelled this by adding a connection entity that has an ID to the parent component and an ID to the child component. The idea is that for the items that may fail there is a connection for the normal working condition and another connection for each failed situation. For example, if there are 40 components of which 9 may fail then I have 2^9 (512) possible failures and 2^9 connection entities for each component. Each connection is named for the failure mode that it represents.

So far, so good, very flexible and works.

However, every time that the bus diagram is loaded all the connections are loaded resulting in 40 * 512 (20480) connection entities when only 40 are needed for the current failure mode and, not surprisingly, this is causing the application to hog resources and run slowly.

So, I have defined a FilterDefinition to restrict the connections loaded to the required named connection if the component is of a particular type and the normal connection if it is any other type and added this to the connections collection mapping of the component enabled the filter and set the parameter.

public FailureModeFilter()
{
    WithName("FailureName")
        .WithCondition("((Name = :name and ObjectType <> 8) or 
                         (Name = 'Normal' and ObjectType = 8))")
        .AddParameter("name", NHibernateUtil.String);
}

And not at all surprisingly, this works.

But, and you knew there was going to be a snag didn’t you?

But, when a new failure mode is chosen and the diagram reloaded, it doesn’t apply the new filter but retains the old one. I’ve tried setting the new parameter, disabling the filter, enabling it again and setting the pararmeter all to no avail.

So, what am I doing wrong/failing to do/misunderstanding (delete as applicable) or, failing that, any suggestions as to how to solve this?

The same session is being used while the diagram is open. Yes, I know that isn’t the suggested best practise, but for other reasons it is the best solution for this part of the application. Please don’t get side-tracked about this telling me about how this is bad practise with doom, gloom and depondency as I already know. The question is about the changing of the filter.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:25:20+00:00Added an answer on May 20, 2026 at 10:25 am

    Answered my own question for a change.

    This answer is to refresh the component to force a reload from the database.

    session.Refresh(entity);
    

    So simple when you figure it out!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which having at least 50-55 models with on an average
I have a Rails application with several models-views-controllers which have some similar characteristics, for
Does anyone have a sample application which makes use of mapping models in particular
I have a model in my rails application which is class Person < ActiveRecord::Base
I have a python (pygtk) application which starts in different modes depending on arguments.
in my zf application i have base model class Application_Model, which connects to db
In my application, we have a view model object from which we're retrieving its
I have application which uses Sherlock ActionBar package. The application uses platform-specific behavior for
I have application which needs to use a dll (also written by me) which
I have an application which uses the microsoft kinect device. The thing is that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.