.netTiers Implementation

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/23/2010 9:21:28 PM
Gravatar
Total Posts 13

.netTiers Implementation

Used .netTiers to create a custom app and now we want to implement that with mojoPortal. We converted the CodeSmith generated pages to UserControls and registered those as modules. We then created mojoPortal pages and added the modules to the page. The pages that perform searches and retrieve information for editing work.

The problem is that the Insert and Update functions cause a Sql Timeout error.  The application hangs and an error message like the following is in the mojoPortal system log. We tried using both stored procedures and embedded Sql statements for the .netTiers.

2010-11-23 20:41:52,340 ERROR mojoPortal.Web.Global - 68.190.10.213-en-US - /OrganizationEdit.aspx?OrganizationId=1
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteReader(DbCommand command, CommandBehavior cmdBehavior)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command, DbTransaction transaction)
at Catering.DAL.Utility.ExecuteReader(TransactionManager transactionManager, DbCommand dbCommand)
at Catering.DAL.SqlClient.SqlOrganizationProviderBase.GetByOrganizationId(TransactionManager transactionManager, Int32 _organizationId, Int32 start, Int32 pageLength, Int32& count)
at Catering.DAL.Bases.OrganizationProviderBaseCore.GetByOrganizationId(TransactionManager transactionManager, Int32 _organizationId)
at Catering.Web.Data.OrganizationDataSourceView.GetSelectData(Int32& count)
at Catering.Web.Data.BaseDataSourceView`2.GetCachedData(Int32& count)
at Catering.Web.Data.BaseDataSourceView`2.GetEntityList(DataSourceSelectArguments arguments, IDictionary values)
at Catering.Web.Data.BaseDataSourceView`2.ExecuteSelectCore(DataSourceSelectArguments arguments)
at Catering.Web.Data.BaseDataSourceView`2.ExecuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.FormView.DataBind()
at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
at System.Web.UI.WebControls.FormView.EnsureDataBound()
at System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

Any thoughts to get us going in the right direction?

11/24/2010 8:30:51 AM
Gravatar
Total Posts 18439

Re: .netTiers Implementation

How are you passing in your connection string?

mojoPortal uses a connection string from the<appSettings section but my guess is with the tools you are using you need to setup a connection string in <connectionStrings section

Hope it helps,

Joe

11/24/2010 8:38:42 AM
Gravatar
Total Posts 13

Re: .netTiers Implementation

You are correct. The tools we used want to pull the connection string from the <connectionStrings> section. We added the <connectionStrings> section to the web.config file. It "seems" like it is working because we can pull back information from the application database.  I say "seems" because something is obviously not exactly right because the Insert and Update functions aren't working.

11/24/2010 8:45:52 AM
Gravatar
Total Posts 18439

Re: .netTiers Implementation

Ok, so you are getting a connection, sorry but I cannot diagnose the problems with your code that I have no idea about. If you have long running operations you may need to add appropriate indexes, review the efficiency of the sql statements, set a longer timeout on your connection and command etc

I don't know anything about .netTiers and cannot offer any support for it. Maybe others in the community have used it and could help further.

Best,

Joe

11/24/2010 8:52:58 AM
Gravatar
Total Posts 13

Re: .netTiers Implementation

Thanks for the replies.

I was hoping maybe someone had encountered this before. It is not a heavy transaction, just adding/updating 1 record with a minimal number of fields. It seems straightforward enough...

 

 

 

11/24/2010 9:03:38 AM
Gravatar
Total Posts 18439

Re: .netTiers Implementation

make sure the table has a primary key and make sure you are using the same connection string for insert and update as you are for select. a simple typo could cause it.

11/24/2010 9:26:14 AM
Gravatar
Total Posts 13

Re: .netTiers Implementation

Yes. The table has a primary key and the code is using the same connection string. The app is an existing app that works outside of mojoPortal. We were just converting the application pages to UserControls. We wanted to see if we could combine the features of mojoPortal with the features of some auto-generated code. I think it can be done... just need to get through some of these oddities.

11/24/2010 9:31:54 AM
Gravatar
Total Posts 18439

Re: .netTiers Implementation

I don't know if .netTiers generated code uses any ASP.NET PageMethods, but if they do, that won't work in a UserControl.

11/25/2010 7:50:08 AM
Gravatar
Total Posts 13

Re: .netTiers Implementation

Solved the probkem... Put the code away for awhile, worked on something else, got a good night sleep, re-investigated the web.config file Forgot to to include the EntityTransactionModule configuration in the httpModules section Thanks Joe - onto the next challenge (or stupid mistake)
11/30/2010 5:02:45 PM
Gravatar
Total Posts 1

Re: .netTiers Implementation

Hello,

I think this is a bug in the .netTiers generated code. This has been fixed in revision 858 of the templates. This can be downloaded here.

Would someone mind writing a blog post on integrating .netTiers with their mojoPortal? I'd love to mirror this content smiley

Thanks

-Blake Niemyjski (CodeSmith Software Development Engineer and .NetTiers Team member). 

11/30/2010 5:15:53 PM
Gravatar
Total Posts 13

Re: .netTiers Implementation

There might be a bug in the .netTiers framework... but my problem was that I missed copying a configuration setting from the .netTiers generated web.config file to the mojoPortal web.config file. Specifically, it was the EntityTransactionModule configuration in the httpModules section. I have a series of notes on what I did for the integration.. maybe I will turn that into a blog post..

Anyone else interested in something like that?

11/30/2010 5:49:17 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: .netTiers Implementation

Definitely. I'm always interested in hearing about new ways to extend mojoPortal!

12/24/2010 4:13:16 PM
Gravatar
Total Posts 13

Re: .netTiers Implementation

For those interested, I started a blog focused on mojoPortal and netTiers integration. This will be a three part series using one table to illustrate the overall concept.

Thanks to Joe and others for helping me get started on this.

12/29/2010 2:10:06 PM
Gravatar
Total Posts 13

Re: .netTiers Implementation

12/30/2010 12:01:15 PM
Gravatar
Total Posts 18439

Re: .netTiers Implementation

Good posts! I'm sure those will be helpful to others that want to use .netTiers.

Best,

Joe

12/30/2010 12:11:37 PM
Gravatar
Total Posts 13

Re: .netTiers Implementation

Thanks Joe... There is one more post yet to come that will complete this first series. As I work through the details, I definitely see opportunity to make these work and even enhance the overall solution. I believe we have just hit the tip of the iceberg as far as the integration goes. 

I hope it will be helpful for others.

2/14/2011 3:01:09 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: .netTiers Implementation

Hi jrager

I'm at the other end of Canada on Vancouver Island.

I was hoping for something like this when I did a search in the mojoPortal forums on "netTiers".  When is the 3rd Blog post coming?

I'm about to start a netTiers/mojoPortal Implementation on a very small personal project and finding this post and your Blogs is a god send.  I'm going to follow your steps and also document everything along the way.  I have already created my database scripts for 6 small tables and my empty mojoPortal feature that creates the tables and inserts some initial data.

I was totally amazed at netTiers generating a whole Application Framework with multiple Visual Studeo projects and database Stored procedures, etc as well as a functioning Website with table editing pages in 10 seconds.  Amazing!

Wish me luck!  I'll be watching for that 3rd blog.

Rick(ARVIXE)

2/14/2011 3:16:12 PM
Gravatar
Total Posts 13

Re: .netTiers Implementation

Rick

Totally forgot about the third blog posting :(

We got really busy at work with hiring employees and starting new projects.

Regardless, I will get that out there today...

Please keep us updated with your implementation. I would like to share ideas and make this really work!

Thanks

2/14/2011 3:33:06 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: .netTiers Implementation

Hey jrager.  You replied in just a few minutes and are doing a 3rd Blog today.  Wow!  Where's your "Buy me a Beer Button"?

Ok, I'll keep you updated with my implementation.

Thanks

2/15/2011 8:03:20 AM
Gravatar
Total Posts 13

Re: .netTiers Implementation

The third post is available.

http://www.keysysconsulting.com/create-the-mojoportal-pages-part-3.aspx

Please share ideas and thoughts.

2/15/2011 12:50:39 PM
Gravatar
Total Posts 18439

Re: .netTiers Implementation

Hi Jarick,

Excellent posts! I've created a page here linking to your posts in order to make them easier to find for mojoPortal users/developers.

http://www.mojoportal.com/using-nettiers-with-mojoportal.aspx

If you ever decide to do away with your blog I hope you'll let us copy those posts into local articles here so they don't ever get lost. I know I've linked to articles on community member blogs in the past only to have them disappear a year or so later. Hopefully your blog will be online for a long time to come but if you ever decide to take it down please let us know so we can copy your articles here to keep a permanent copy (listing you as author of course).

Also let us know if you post any more and we will link to them as well.

Best,

Joe

2/15/2011 1:58:03 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: .netTiers Implementation

Hi Jarick

Thanks for the Blog #3 so quick.  I have copies all 3 Blogs to a word doc and am adding my own details and comments as I proceed.  I'll use the contact us form on your company website to contact you for your email.

Rick (ARVIXE)

2/15/2011 2:12:28 PM
Gravatar
Total Posts 13

Re: .netTiers Implementation

Awesome...

 

Look forward to feedback and making this process better!

2/17/2011 1:35:50 AM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: .netTiers Implementation

Thanks Jarick

I followed Jarick's 3 blog post and successfully implemented netTiers into mojoPortal 2.3.6.2.  It works great!

I converted 6 pages created by netTiers that now display Gridview data from 6 MS SQL Server database tables I created in mojoPortal.  It wrote my stored procedures too.  I also converted the nrtTiers generated edit pages for the 6 tables and everything works like magic. netTiers generates code based on Microsoft's recommended patterns and practices.  I Didn't write any code!!!  netTiers even created dropdown edit lists for all fields with foreighn keys to my lookup tables.

Is this better than the other 50 methods out there for doing similar code generation?  I have only used netTiers for a few days but I have tried other  commercial products.  So far I really like the price (netTiers is FREE open source like mojoPortal).  So far I really like netTiers too.  It writes amazing code in just a few seconds.  I'm going to spend more time with netTiers and start using it with Telerik controls and see how that goes.  If that works well there will be no turning back.

I'll keep you posted.

Oh ya did I say... I Didn't write any code!!!

Rick(ARVIXE)

 

2/24/2011 11:29:26 AM
Gravatar
Total Posts 13

Re: .netTiers Implementation

I updated the blogs with comments provided by Rick Hubka with Arvixe.

 

Thanks Rick for the feedback.

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