Configuration / deployment newbie head-scratching...

Configuration / deployment newbie head-scratching...

Old forum URL: forums.lhotka.net/forums/t/4357.aspx


dbsaxman posted on Friday, February 15, 2008

Apologies in advance if I seem a bit dense.  Though I've read the book Expert C# 2005 Business Objects, and even some chapters numerous times (such as Chapter 12), I'm still having difficulty understanding how to move forward with CSLA, primarily with respect to configuration, deployment etc. 

From the reading it seems the "remoting" portal makes the most sense for me.  But I'm still having a gap in understanding, mainly because I haven't quite got the sample app working.  So I'll just try to explain our environment and what I'd like to do.  I'd like to use CSLA on an internal website within our company.  I've got the sample PTWeb app running to some degree on my local machine (I can run it and the web pages display, but I can't edit the data).  I'm still getting an error trying to run the app on my development machine.  I'm inclined to not worry about it too much, because we don't use SQL Express or MDF files in the real world and I'd just like to get the app running using the regular SQL Server (we have SQL 2000 in production, soon to upgrade to 2005; and I have SQL Server 2005 on my development machine).  In any case, the error is:

Failed to update database "C:\CSLA\PROJECTTRACKER20CS\WWW\PTWEB\APP_CODE\PTRACKER.MDF" because the database is read-only.

But as I said I'm inclined to not worry about that, and just try to get it working with our existing SQL Server.  My setup is as follows:

On my development machine I have Visual Studio 2005 and SQL Server 2005.  I've got IIS 5.1 running on the dev machine.  I write code in ASP.NET 2.0 / C# 2005.  Our production app is an internal web server that runs some ASP.NET 1.0 and ASP.NET 2.0 apps.  Physically, there's a web server machine (running IIS 6.0) and a database server machine (running SQL Server 2000).  We use Windows integrated security to differentiate users with different security levels with respect to the website.  I'd like to continue using integrated security when I introduce CSLA.

I have a project that would seem to perfectly lend itself to the use of CSLA.  The business objects I expect to design are similar to the sample app.

Here's what I'd like to do, and my questions.  Any suggestions would be greatly appreciated.

a) I want to get the sample app running, but using our existing SQL Server instead of SQL Express, because that's more like what we do in the real world.  I assume that means I would need to script the databases and stored procedures so they exist on our server and point the connection strings in the web.config file to the appropriate server and database, etc.  Is that right?

b) If I manage to do that, but assuming I'm still running the app from my development machine, I assume that means I would continue to use the "local" portal when developing.  So at that point, I'm using IIS on the local machine, but accessing the data on the SQL Server on the database server.  So far so good (if I can get it to work).  Am I correct on this general point also?

c) Here's where I really need help understanding and where I'm feeling a bit stupid.  So, I assume to deploy the app to production (i.e., to the web server), I would just essentially flip a switch in the config file - i.e., tell CSLA to use the remoting portal instead of the local portal.  In other words I would do what it says to do in Chapter 12, regarding the remoting portal; i.e., comment out those lines when I'm developing and using the local portal, then implement those lines when I want to deploy.  Then as I change code, I assume in Visual Studio I would just "Publish Web Site" ?  And then it all just magically works?  This is what I don't quite get from all the reading of the book and the forums... in other words, if I just deploy all the files (as in PTWeb for example) and the web.config file contains the lines as described in Chapter 12, it should all just work with respect to IIS etc?  Or is there something else that runs on the web server with respect to CSLA?

Any help appreciated.  Thanks.  --Dave Barrows








JoeFallon1 replied on Friday, February 15, 2008

Don't worry too much about the sample app. I never got it running - you don't need it to understand the concepts.

The biggest idea about local and remote dataportals concerns this question:

Can the Web Server make a connection to the Database or not? If the answer is Yes then you will end up using a local data portal. So in your case I think your Dev and Production environments will both be local dataportals.

If the answer is NO then 1 web server has to communicate with a 2nd web server. The 2nd web server talks to the DB. This is the remoting scenario. It does not apply to you. This scenario is most often seen when the 1st Web Server is in the DMZ and must be firewalled off from the company network. This web server remotes BOs to the 2nd server inside the firewall which then talk to the DB and then serialize themselves back to the first server.

 

Joe

 

dbsaxman replied on Friday, February 15, 2008

Hi Joe, thanks for the information, very helpful.

Yes, the web server can make a connection to the database.  Based on your statement then, I'll use the local data portal.

I appreciate your reply, thanks again,

Dave

Copyright (c) Marimer LLC