Hello,
Updated below
I couldn't describe the question any better without going into detail.
I am having major issues with development/deployment of projects using SubSonic. Up until now everything has been fine but this is seriously hampering my progress.
The project, while not important, is a CMS/Shopping Cart.
I am using
- Visual Studio 2008 (C#)
- SubSonic 3.0.0.3 (or 3.0.0.4 ?) with Active Record T4 templates (Ones that come in dist)
- MySQL ADO.NET 6.2.2.0 Connector
- MySQL 5.1 Server
Basically, I found over the past few days that there is connection pooling issues with the connector below version 6.2.2.0. So I updated this and at the same decided to get the new SubSonic assembly as I assumed that may the issue(although it says 3.0.0.4 the DLL still says 3.0.0.3?).
I'm a techie so fairly able to root out issues and solve but this is escaping me. This issue "seems" to only happen when developing when I access a remote database server (I have no permanent way around this).
The error message:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Not to be obvious but the server is there. As the live site is using it and is more than capable of responding within the time period. I realise that each new connection string creates a new pool but the default is 100. The live site is not being used heavily at the moment.
It seems to be an delayed/random issue as 10 mins later (now) it is connected for Visual Studio 2008.
I have read a few posts on here, some in relation to closing connection objects in the T4 templates. From what I can see they are being closed explicitly [ conn.Close(); ] or using [ cmd.ExecuteReader(CommandBehavior.CloseConnection); ].
Maybe there is an issue with the templates? Maybe not. I did have to modify small elements like Database types etc but nothing to do with connections etc.
(On point of this, is there any updated templates that have been released that work with unsigned types? Sorry, off topic I know but this is something I have been waiting for.)
Maybe the templates are creating too many connections? Though netstat only shows one connection.
Any ideas?
I'd appreciate any comments, hopefully I have given you enough to go on.
Updated 06th April 2010
Ok, so I eventually realised that the updating of the components to their newer versions did in fact solve the multiple connection/pooling issue so that just leaves the remote connections. No matter what I do it still times out.
I did copy the database to a local server on the network and it works fine so at first glance you would assume it is simply timing out to the remote server but that would not explain why it used to work. In fact other projects using the same remote server that do not use SubSonic but do use the .NET connector work fine.
Here's the screw in the wheel bit, it's not consistent. Sometimes it is fine, sometimes it is not. When it does happen, it stays like that for sometime.
To me it points to SubSonic but then I'm not sure of any tools that would pin point that for me. By any means, I am not slating SubSonic. It could be an issue with my t4 template(s), it could even be a bug in the SubSonic core that I have seemingly come across and it may even be a coding issue on my part. It would be great to be able to narrow it down.
Here are my ActiveRecord tt files: http://www.gigastence.com/ActiveRecord.zip I haven't really modified them all that much from what is distributed. Obviously types have to be changed for the MySQL data types. I'm not using the stored procedures as I don't believe MySQL procedures have been handled yet.