Free Support Forum - groupdocs.com

SaaS implementation with multiple DB connections


#1

I having an issue integrating the annotations tool into my web forms .net project connecting to one SQL Server 2012 Database. The reason, I believe, is there is a requirement to set the connection string be dynamic to the user session and not to the applications. The user may have access to N databases. When a user logs in, he logs into 1 of many databases but uses the same web site. The user should be able to go to a page that loads a file into the groupdocs Annotation tool, but the Initilize method must be called in Page_Load event, not the Application_Start event in the global.asax since another user may need to load a file from a different database


Is it possible to call Initialize in the Page_Load with the following method signature?:
– Remember: Session[“DB_CONNSTRING”] could be for different Databases for each user
Groupdocs.Web.Annotation.WidgetFactory.Initialize(this.Context,"~/App_Data",Session[“DB_CONNSTRING”].ToString());

When I try to implement this I receive the following error after the first initialize:

A route named ‘signalr.hubs’ is already in the route collection. Route names must be unique.
Parameter name: name



#2

Hello,


We are sorry to hear that you have such issue. The issue reason is in the GroupDocs.Annotation initialization, it can be done only ones during application work (when it called for the first time after application start). For now you can call Initialize method in any place of the application logic but only once.

We will investigate this feature and if it possible we add it to our roadmap. We will notify you at the next week with the results of the investigation.