Web Application Architecture Using Nhibernate

Dec 10, 2010

I'm designing my first asp.net web app, using nHibernate as the data provider. i've read a lot about nhibernate in web applications using session-per-request pattern. my application will have a few pages which are 'monitors', meaning- they're updated automatically every few seconds to reflect recent changes to data. in that case, my thought is that opening a session for every request would not make much sense, since I know that an identical request is sure to follow in a few seconds. my thought is that session-per-conversation would make more sense for me, but I'm having trouble finding examples of implementations. I'd appreciate any good resources for how to implement session-per-conversation

View 2 Replies


Similar Messages:

.net - Architecture With NHibernate And Repositories?

Apr 13, 2010

I've been reading up on MVC 2 and the recommended patterns, so far I've come to the conclusion (amongst much hair pulling and total confusion) that:

Model - Is just a basic data container Repository - Provides data access Service - Provides business logic and acts as an API to the Controller

The Controller talks to the Service, the Service talks to the Repository and Model. So for example, if I wanted to display a blog post page with its comments, I might do:

post = PostService.Get(id);
comments = PostService.GetComments(post); Or, would I do:

post = PostService.Get(id);
comments = post.Comments;

If so, where is this being set, from the repository? the problem there being its not lazy loaded.. that's not a huge problem but then say I wanted to list 10 posts with the first 2 comments for each, id have to load the posts then loop and load the comments which becomes messy.All of the example's use "InMemory" repository's for testing and say that including db stuff would be out of scope. But this leaves me with many blanks, so for a start can anyone comment on the above?

View 1 Replies

How To Start A New Application And Am Excited About Using Mvc And Nhibernate

Mar 11, 2010

I am about to start a new application and am excited about using asp.net mvc and nhibernate. However, the big "problem" is how I handle the user authentication stuff. What are some ways those used to using nhibernate and MVC solve this problem?

My thought is let asp.net do its own thing and I do my own thing database wise. Am curios if I should role my own using the provider model and nhibernate, if I can figure out how. Or is there a way to integrate current code that is in the mvc example into nhibernate?

View 3 Replies

C# - How To Handle NHibernate Sessions In WebForms Application

Jul 16, 2010

I see there are 2 possible scenarios as to the session handling:

Open one single ISession per request. Open it at request start and close it at request end.Open one ISession per conceptual "unit of work". Many sessions are created for a request.

The approach #1 is the one I'm doing now. I'm a little bit worried about it because, although it works, it's a little bit difficult to debug. For instance, I have an object not being saved (even though I ordered it to) and I'm having trouble debugging since there's a LOT of things happening during a complete request life-cycle.

The approach #2 seems to be the standard best-practice (not sure about ASP.NET) and I'm sure it's pretty easier to debug. The problem I see is about inter-session communication. For instance: My Page class holds a reference to the User, which is a persistent object. Many of the operations receive the user as parameter. As the user belongs to a different session, I can't pass it as a parameter.

I'm biased to #2, but I don't know if it's the best practice, nor how to deal with cross-session object.

View 4 Replies

MVC :: Implemented NHibernate / Application Completely Unstable?

Jun 1, 2010

I tried to figure out NHibernate (a first) First went through chapter 23 in Asp.Net MVC in Action 2, and read some articles to get the drift.

Then I modified the sample in the above book to work with my own database and my own table. Finally got that working. (Started messing with this yesterday afternoon....it's 7:30 AM, so .... I'm tired...)

Then I worked this into my own project (the shared mvc template some of you might have looked at).

Now my application became completely unstable. Sometimes it work, but other times it bombs out where my controller factory (Castle) set the component lifestyles:

[Code]....

Each time with some LoaderException that read like {"Could not load file or assembly 'Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc"}

Man I fiddled all over the place, having xcopy copy dll's (see krok.web properties got a post build event) and many other things I that does not really make sense.

And from the darned instructions, having all your dll's in a folder which get copied out to the web project's bin folder and dont know what else.

Seriously...if someone can download this and have a look (better not if you dont know Castle Windsor and NHibernate)

View 3 Replies

Managing NHibernate Sessions For Multi-tenant Application?

Oct 15, 2010

I have scoured the web and have yet to find and example that matches my requirements.

What I have is an existing multi-tenant asp.net application where all users authenticate against a single SQL Server database. This database also contains several other settings type data that is used within the application. Each client after authentication, utilizes thier own SQL Server database for data storage, for isolation purposes. Essentially all of the client database are identical and reside on the same server, but reside on one or more servers as well.

The application is currently written in asp.net 2.5 framework and utilizes the Micrsoft Practices Enterprise Library for DAL. Wnd we are looking to migrate to 4.0 and implement NHibernate to replace the MPEL.

I have implemented a solution already using NHibernate and the 4.0 framework, so I am familar with the concepts. I found the resources for my current session manager here as a matter of fact. But that application only had a single database, so not much too it.

The implementation is essentially what you see here:

[URL]

The other solutions that I have seen multiple config entries and/or files to manage this, but that is not desireable, since we may add new clients frequently and all of the connection information is already maintained in the authentication database.

[code]....

View 1 Replies

Architecture :: Auto Update Application Like In Wordpress, Application Must Check If New Updates Are Available?

May 3, 2010

I need to auto update application like in wordpress, Application must check if new updates are available, download this updates and install.But I don't know how to install application. Because if some files in bin directory are updated application is restarted.Is it possible to create ASP.NET web application which will be auto updatable?now we have a new technologies, could u please suggest me any kind of soultion for the above problem. here i am enclosing my email idsunnyb4uu@hotmail.com

View 2 Replies

Architecture :: Design An Application To Fetch Data From Different Application Databases

Nov 10, 2010

I need to develop an application, which will get records (orders) from one application and process them. The updates to this records (order updates) will be sent back to the source application for end customer reference. I'm planning to achieve this data synchronization at the database level using triggers and stored procedures to insert database between the 2 databases.

But, the issue is I have to deploy this application in 3 different customer sites and I have to change the database names (cannot use the same database name) in each deployment manually. Because of this deployment issue, I was thinking of handling this within the asp.net application where I can store the db name in the database and then build the query within the application, but I dont want to do it as building queries like that doesnt look very professional.

View 2 Replies

Architecture :: Best Way To Pass A Values From One Application To Another Application?

Dec 8, 2010

Which is the best way to pass a values from one application to another application in asp.net

View 5 Replies

Architecture :: Best Way To Kill Session From One Application To Another Application In C#?

Dec 8, 2010

Which is the best way to kill session from one application to another application in C#

View 5 Replies

Architecture :: Want To Create Another Application Or Sub Application?

Aug 25, 2010

I m sure this question has been asked before. I have a web application hosted underhttp://localhost/abc. which is mapped to c:inetputwwwrootabc folder. I have APP_Code, App_LocalResources, BIN and other folders under abc folder. Everything is great. Now I want to create another application or sub application
http://localhost/def. Both abc and def apps need to use some common classes and resources. Whats the best way to do it. I dont need to create a separate application for def. All i want is the url
http://localhost/def.

View 3 Replies

Use MVC Architecture In Web Application?

Nov 2, 2010

I am beginner in MVC architecture, how to use MVC architecture in Web applicaion?

View 2 Replies

Architecture For A Web Application With Sub-Apps?

Jan 17, 2011

I'm starting to plan an architecture for a big web application, and I wanted to get suggestions and/or recommendations on where to begin and which technologies and/or frameworks to use.The application will be an Intranet-based web site using Windows authentication, running on IIS and using SQL Server and ASP.NET. It'll need to be structured as a main/shell application with sub-applications that are "pluggable" based on some configuration settings.

View 3 Replies

Architecture :: Use Different Database For One Application?

Nov 24, 2010

How to use different database for One Application

View 6 Replies

Architecture :: To Design Application?

Jan 18, 2011

I am very new to application design, how and from where should i start to design application

View 3 Replies

Architecture :: Web Application From Scratch?

Apr 21, 2010

I have to build a web application from scratch(a 4-layer architecture). give me a checklist that are required such as tools, how to create the projects and their references,writing base page classes, how to set up and configure the application in Visual studio(asp.net 2.0 or above versions) ,IIS, database server, source safe and cruise control tools as well as the structure of the project.

View 6 Replies

Architecture :: Going To Develop A Web Based Application With C#?

May 30, 2010

i am going to develop a web based application with c# but i am very upset that how to design a good pattern how to code to let the program more efficient.

View 3 Replies

Architecture :: Transfer Data From One Application To Another

Feb 26, 2010

i am new in asp.net. i have create a website. its related to tours and travels. Now when any customer get login to webportal then the login info of that customer should send to my system i.e. website. here it will check the user is valid or not or new according to that check user's permissions and send the data to the webportal.

then customer can search the specific data and book the some data say 'hotel'. that time the booking information should send to back to the system. so my query is how can i send the information from my system to webportal and vice versa...(can i do it with javascript)

View 4 Replies

Architecture :: Modelling Application Layers?

Jan 26, 2010

I'm trying to create my first Asp.Net application from scratch. Tried to create this post in some of the other forums but I couldn't find a better place.

So, as the title says, I'm having trouble trying to model my application. I'm like an OOP newbie. I'll show my classes first and then I'll write my questions.

Model Layer

public class User
{
private int id;
public int Id { get { return id; } set { id = value; } }
private string login;
public string Login { get { return login; } set { login = value; } }
private string password;
public string Password { get { return password; } set { password = value; } }
}
Data Access Layer
public class BasicDAL
{
private SqlConnection connection;
//>>Returns a new connection to the database
public SqlConnection GetConnection()
{
//>>If connection is active close it before starting a new one
if (connection != null)
if (connecion.State != ConnectionState.Closed)
connection.Close();
connection = new SqlConnection("MyConnectionStringHere");
return connection;
}
}
public class UserDAL : BasicDAL
{
//>>Insert a new user
public void Insert(User user); { /* Insert into DB */ }
//>>Authenticate user login with its password
public void Authenticate(User user); { /* Authentication code here */ }
}
Business Logic Layer

[Code]....

So, model layer is pretty simple. Just a user representation. On the Data Access Layer I have a basic class with a GetConnection method. All DAL classes will extend this one.

My first problem lies on Business Logic Layer. With the above scenario, I've placed the same methods that I placed at the DAL. BLL methods would call DAL. As simple as that but I believe It is not the best way to do it, is it? How can I improve those classes?

Also, I have to "try..catch" blocks. That's because I can't find good places for it. I mean, if I place a try..catch on GetConnection method, for instance, how my ASPX page would get this error? How my ASPX page can tell the difference between "database offline" and "sql syntax error" when executing "userBll.Insert(newUser);".

My problem is mainly placing the exception handlers. I understand I would probably have to change return type of some methods. I didn't change because I believe that will have something with the exception handlers.

Btw, please assume I can't use TableAdapters and stuff like that. I would like to create all layers by myself.

View 3 Replies

Architecture :: How To Develop Web Application With Sub-Apps

Jun 18, 2010

I'm starting to think about and develop an architecture for a big web application, and I wanted to get suggestions and/or recommendations on which technologies and/or frameworks to use.The application will be an Intranet-based web site using Windows authentication, running on IIS and using ASP.NET. It'll need to be structured as a main web application with sub-web applications. Essentially, the entire scope is a composite browser-based,Intranet application that is composed of discrete, functionally complete modules or sub-applications.

View 1 Replies

Architecture :: How To Get Default Namespace Of Application

Mar 11, 2011

Anybody know how to get default namespace of ASP application programatically?

[Code]....

View 3 Replies

Architecture :: .NET Web-Application Architectures / Patterns?

Jul 9, 2010

Does anybody knows good, short and slim tutorials (not here ), which describe actual/modern web-application architectures / patterns (especially for ASP.NET based (classic and MVC) applications (maybe also with embedded Silverlight components) ? How would you you design today an ASP.NET application which uses different datasources (databases, services,...) ? Background: I has been away a couple of years writing web applications, and I want to start now again. So at the moment I am a little bit unsure, how to take off and find the right starting point.

View 3 Replies

Architecture :: Using Windows Service In Web Application?

Sep 10, 2010

I wanna embed the windows service in the web application. I have seen few posts in the web. where they generate separate exe for the windows service and use it as an installable.

The same process i tried doing it but it threw an OS error in my server which is windows 2000 and didnt supported the executable.

However the website of mine runs fine in the same server. Thus i was thinking if i cd embed the same code in the web application.

Also, in my case the website of mine takes job for simulation. These jobs are taken for simulation execution and nearly takes 12hrs for completion and if they are not completed within twelve hours then they are supplied extra twelve hours to complete the simulation jobs.

The simulation executables are a series of executable and bat files.

The results of the simulation gets updated in the tables of MySql and hence are displayed to the user.

View 2 Replies

Architecture :: Offline Capability To A Web Application?

Jan 19, 2011

I have a web application which contains details about job vacancies and applicant postings. Now this same application has to be made available to a central operator who will either connect to the web application or for some unavoidable situation if the connectivity to the web application cannot be made connect to an offline version of the application and make any updates, modifications to the content of the web application. The operator can also apply for job postings on behlaf of other users.

My question is, how do I develop this offline capability in situations where the connection to the web application cannot be made?

View 3 Replies

Architecture :: Framework For A ERP Web Based Application

Mar 31, 2010

I am designing frameWork for an ERP application ijust have some quries regarding it

Some standards have to be set for this project ,need some help for it.

1)folder structure of the project for frame work 4.0

2)Layering should be done like(3 tier,n tier) if i want to Go for more than 3 layers what could be the other layers except BAL,DAL,Presentation.

3)should all the images be called from css,or some images can be called from the page it self.

4)what benchmarks should be set while writing Stored procs,to make uniformity and increase performance.

5)what securtiy messaures should be taken so that application remains free for intruders.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved