sqllite "Invalid ConnectionString format for parameter \"defaultdblocation\"

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
10/11/2008 12:33:56 PM
Gravatar
Total Posts 2

sqllite "Invalid ConnectionString format for parameter \"defaultdblocation\"

I downloaded the 2-2-7-3 sqllite release of mojoportal and installed it locally on my Vista 64 bit machine. I run the app, add an event calendar to the main page, click on a date and add an event.  When I click to save the event, it takes an extended time (30 seconds or so) for the page to refresh and  w3wp throws a System.ArgumentException with the message "Invalid ConnectionString format for parameter \"defaultdblocation\"" with a stack trace of:

" at Mono.Data.Sqlite.SqliteConnection.ParseConnectionString()\r\n at Mono.Data.Sqlite.SqliteConnection.Open()\r\n at mojoPortal.Data.SqliteHelper.ExecuteReader(String connectionString, String commandText, IDataParameter[] commandParameters)\r\n at mojoPortal.Data.DBIndexingQueue.GetIndexPaths()\r\n at mojoPortal.Business.IndexingQueue.GetIndexPaths()\r\n at mojoPortal.Business.WebHelpers.IndexWriterTask.ProcessIndexingQueue()\r\n at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTask()\r\n at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTaskOnNewThread(Object oTask)\r\n at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)\r\n at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)"

I installed mojoportal on my 32bit Vista machine and get the same error.  I haven't had a chance to get the source and try to debug it but figured I'd put the report in.

-- Namzat

10/11/2008 1:26:31 PM
Gravatar
Total Posts 18439

Re: sqllite "Invalid ConnectionString format for parameter \"defaultdblocation\"

Hi Namzat,

Thanks for letting me know. I see the problem in DBIndexingQueue.cs

It has this method to get the connection string:

private static string GetConnectionString()
{
string connectionString = ConfigurationManager.AppSettings["SqliteConnectionString"];
if (
(connectionString == "defaultdblocation")
&& (HttpContext.Current != null)
)
{

connectionString = "version=3,URI=file:"
+ HttpContext.Current.Server.MapPath("~/Data/sqlitedb/mojoportal.db");

}
return connectionString;
}

This causes an error because the taskqueue is processed on a background thread and HttpContext.Current will always be null.

Ths fix is to change the method like this:

private static string GetConnectionString()
{
string connectionString = ConfigurationManager.AppSettings["SqliteConnectionString"];
if (connectionString == "defaultdblocation")
{
connectionString = "version=3,URI=file:"
+ System.Web.Hosting.HostingEnvironment.MapPath("~/Data/sqlitedb/mojoportal.db");

}
return connectionString;
}

I will be making a new release within a few days.

Thanks,

Joe

 

10/11/2008 1:29:05 PM
Gravatar
Total Posts 2

Re: sqllite "Invalid ConnectionString format for parameter \"defaultdblocation\"

Just got the code down and saw the same thing...you beat me to it! :D

Thanks!

--Namzat

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