The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

How do I handle muiltiple database connections in the same DNN module?

Last post 08-28-2007, 6:22 AM by Scott.Schecter. 4 replies.
Sort Posts: Previous Next
  •  08-27-2007, 6:47 PM 4800

    How do I handle muiltiple database connections in the same DNN module?

    We are currently evaluating es and I am stumpted. I have added 5 entries to web.config, one for DNN itself plus one for each of the country specific databases our host will support via multiple portals on the same site.  I have also configured global.asax to register the loader.  The web site will always use the DNN database for DNN/module specific stuff, but use the specific country's database for application data.  The databases are SQL Server and replicated from the target country's local database to the web server and visa versa.  Consequently there is no opportunity to place all tables in the one database.  Therefore each module needs to interact with data from two databases, depending on whether the data is DNN/Module data or application data.

    Firstly, I keep getting an error in the module "Object reference not set to an instance of an object" as soon as I try to execute any data retrieval method; LoadByPrimaryKey, LoadAll, etc.  I have verified that prior to the read request, the database default has been set to the correct database.  I'm not getting anywhere with this due to the lousy degbugging in .NET (the DNN server is not local so cannot use runtime debugging) so any help would be greatly appreciated.

    Secondly, I need to know how to handle the database switching for the two sets of tables.  Is this efficient in the es environment, or is it just too hard/inefficient and I should go back to DNN DAL where I have absolute control?

  •  08-27-2007, 7:07 PM 4801 in reply to 4800

    Re: How do I handle muiltiple database connections in the same DNN module?

    EntitySpaces is easier to connect to multiple db's with than dnn once you get it setup. Check your config against this post.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  08-27-2007, 8:19 PM 4802 in reply to 4801

    Re: How do I handle muiltiple database connections in the same DNN module?

    That solution is not appropriate since it changes the site default, which of course is being shared by many users from different countries, and thus different databases (as per my original post).

    I note that you can set the connection.name property as you invoke each es object which is ok, but I STILL cannot get past the "Object reference not set to an instance of an object" error and I'm about to give up.  If I can't resolve this problem, I'm dead in the water.

  •  08-28-2007, 12:00 AM 4804 in reply to 4802

    Re: How do I handle muiltiple database connections in the same DNN module?

    Could you post your Web.config with any passwords removed form the connection strings?
    David Neal Parsons
    www.entityspaces.net
  •  08-28-2007, 6:22 AM 4810 in reply to 4804

    Re: How do I handle muiltiple database connections in the same DNN module?

    Here is a DNN specific example for you using configless operations

    Regards,

    Scott Schecter
    EntitySpaces | My Site
View as RSS news feed in XML