Back to list
Views:   6.5K
Replies:  2

db.cs class declaration static in v4 and not static in v4.5

Why did you change the approach of using the singleton pattern framework v4 and declaring db class as static to now in framework v45 declare it as regular class, and then instantiating a different copy as static per type of resource?

I mean one static instantiation for members, another static instantiation for products, etc was there a reason? perhaps you found it to be a performance bottleneck?


Angel Valdes, Jan 25, 2014
Reply 1
i had a working WCF on the localmachine but when uploading to the datacenter it failed

As the class was static it is created when the service is accessed and the DB user specified didn't have access to the DB, this caused the whole service to fail without generating a catchable exception and  the hosting center wouldn't allow me write a trace log via a listener
so made remote debugging a matter of trial an error disabling code till it started to work

using a non static a simple try catch can be used 

Paul Durrant, Feb 11, 2014
Reply 2

The main reason the static keyword was removed was so it would support multiple database connections concurrently. 
Hope this helps. 

Jack Poorte, Feb 02, 2014
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.