Translate

Thursday, September 6, 2012

Advantage and disadvantage of self hosting?


Advantages of Self-Hosting:
  • Is easy to use : With only a few lines of code you have your service running.
  • Is flexible : You can easily control the lifetime of your services through the Open() and Close() methods ofServiceHost.
  • Is easy to debug : Debugging WCF services that are hosted in a self-hosted environment provides a familiar way of debugging, without having to attach to separate applications that activate your service.
  • Is easy to deploy : In general, deploying simple Windows applications is as easy as xcopy. You don’t need any complex deployment scenarios on server farms, and the like, to deploy a simple Windows application that serves as a WCF ServiceHost.
  • Supports all bindings and transports : Self-hosting doesn’t limit you to out-of-the-box bindings and transports whatsoever. On Windows XP and Windows Server 2003, IIS limits you to HTTP only.

Disadvantages of Self-Hosting:
  • Limited availability : The service is reachable only when the application is running.
  • Limited features : Self-hosted applications have limited support for high availability, easy manageability, robustness, recoverability, versioning, and deployment scenarios. These scenarios have become a standard in last few years. Such features are provided by the WAS (Windows Activation Service) which is a part of IIS7 (delivered with Vista and Win2008). This hosting mechanism allows you to host the service by using of protocols like MSMQ, HTTP and TCP. 

What is charindex?

Sql charindex is a sql server function that indicates the first position of a character or a character string within another character string. When a character or character string is found with sql charindex, the starting position is indicated with a non-zero positive integer value. If a character or character string is not found with charindex, a zero integer value is returned. charindex's starting position is 1, unlike other index search functions that would normally return 0 as the first position. 


CHARINDEX ( expression1 ,expression2 [ , start_location ] ) 


expression1
Is an expression that contains the sequence of characters to be found. expression1 is an expression of the character string data type category.
expression2
Is an expression, typically a column searched for the specified sequence. expression2 is of the character string data type category.
start_location
Is the character position to start searching for expression1 in expression2. If start_location is not specified, is a negative number, or is zero, the search starts at the beginning of expression2start_location can be of type bigint.