Failed to access IIS metabase.
Posted by Zafar Ullah - zafarjcp@gmail.com | 12:08 AM | ASP.NET, IIS | 0 comments »How to control ASP.NET Validator Controls Client Side validation from JavaScript
Posted by Zafar Ullah - zafarjcp@gmail.com | 5:08 AM | .net, ASP.NET, C#, JavaScript, Validator Controls | 0 comments »The only solution is to Enable/Disable the ASP.NET Validator controls on page with JavaScript code to use ValidatorEnable(val, enable) funciton on each page where you need to use both options ( validator control and javascritp).
A very good example is given on the given link :)
http://www.aspdotnetfaq.com/Faq/How-to-control-ASP-NET-Validator-Controls-Client-Side-validation-from-JavaScript.aspx
Quick things to check when you experience high memory levels in ASP.NET
Posted by Zafar Ullah - zafarjcp@gmail.com | 6:44 AM | .net, ASP.NET, C#, IIS | 0 comments »Things to check when you you experience high memory levels in ASP.NET
http://support.microsoft.com/kb/893660
Difference between aspnet_wp.exe and w3wp.exe
Posted by Zafar Ullah - zafarjcp@gmail.com | 3:00 AM | ASP.NET, IIS | 3 comments »The way an ASP.NET request is handled by IIS is quite different in IIS 6.0 when compared with 5.0. In 5.0, the ASP.NET worker process is handed off control by the aspnet_isapi extension in IIS. The aspnet_isapi dll runs in the inetinfo.exe process in IIS and functions what is known as the CLR host (a CLR host is the piece of unmanaged code which is responsible for loading the CLR into the memory). So aspnet_isapi “hands over” the processing to the worker process named aspnet_wp.exe, where the request passes through a series of HttpModules and an HttpHandler.
But in IIS 6.0, there is a driver named http.sys which listens to all the incoming requests (aspnet_isapi.dll is not in the picture at this point). The moment an ASP.NET specific request comes in, this driver starts an IIS 6.0 worker process (which is not related to ASP.NET at all) named w3wp.exe. This process now loads the aspnet_isapi.dll (CLR host) and the request follows through a similar sequence of HttpModules and HttpHandlers.
So the important thing to note here is that w3wp.exe is not an ASP.NET worker process (unlike aspnet_wp.exe) but instead specific to IIS 6.0.
Understanding NHibernate <generator> element
Posted by Zafar Ullah - zafarjcp@gmail.com | 11:35 AM | .net, Hibernate, NHibernate, ORM | 1 comments »Every database supports mechanism to define primary keys and numeric sequence generator. so being and Data Access Layer NHibernate also provide mechanism to handle primary keys and numeric sequence generator.
Before moving to NHibernate numeric sequence generator element, here is a brief description of Primary key and numeric sequence generator(Identity).
Note: Query uses TSQL (Microsoft SQL Server) as its scripting language.
What is Primary Key
A primary key is a table column that serves a special purpose. Each database table needs a primary key because it ensures row-level accessibility. If you choose an appropriate primary key, you can specify a primary key value, which lets you query each table row individually and modify each row without altering other rows in the same table. The values that compose a primary key column are unique; no two values are the same. Each table has one and only one primary key, which can consist of one or many columns.
What is Identity Column
"An identity column creates a numeric sequence for you". You can specify a column as an identity in the CREATE TABLE statement:
CREATE TABLE dbo.Tasks ( TaskId int identity(1,1), TaskDesc varchar(200) )
The identity clause specifies that the column TaskId is going to be an identity column. The first record added will automatically be assigned a value of 1 (the seed) and each subsequent record will be assigned a value 1 higher (the increment) than the previous inserted row.This is how Microsoft SQL Sever provides the mechanism to generate numeric ids in a sequence.
Now coming towards NHibernate which not only provide configuration mechanism to use existing sqlserver functionality but also provide its own generator mechanism.
Primary Key
name="PropertyName" (1)
type="typename" (2)
column="column_name" (3)
unsaved-value="anynonenullid_value" (4)
access="fieldpropertynosetterClassName(5)">
<generator class="generatorClass"/>
</id>
(1) | name (optional): The name of the identifier property. |
(2) | type (optional): A name that indicates the NHibernate type. |
(3) | column (optional - defaults to the property name): The name of the primary key column. |
(4) | unsaved-value (optional - defaults to a "sensible" value): An identifier property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from transient instances that were saved or loaded in a previous session. |
(5) | access (optional - defaults to property): The strategy NHibernate should use for accessing the property value. |
1. generator
<generator class="NHibernate.Id.TableHiLoGenerator">
<param name="table">uid_table</param>
<param name="column">next_hi_value_column</param>
</generator>
</id>
- increment
- generates identifiers of type Int64, Int16 or Int32 that are unique only when no other process is inserting data into the same table. Do not use in a cluster.
- identity
- supports identity columns in DB2, MySQL, MS SQL Server and Sybase. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.
- sequence
- uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.
- hilo
- uses a hi/lo algorithm to efficiently generate identifiers of type Int16, Int32 or Int64, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with a user-supplied connection.
- seqhilo
- uses a hi/lo algorithm to efficiently generate identifiers of type Int16, Int32 or Int64, given a named database sequence.
- uuid.hex
- uses System.Guid and its ToString(string format) method to generate identifiers of type string. The length of the string returned depends on the configured format.
- uuid.string
- uses a new System.Guid to create a byte[] that is converted to a string.
- guid
- uses a new System.Guid as the identifier.
- guid.comb
- uses the algorithm to generate a new System.Guid described by Jimmy Nilsson in the article http://www.informit.com/articles/article.asp?p=25862.
- native
- picks identity, sequence or hilo depending upon the capabilities of the underlying database.
- assigned
- lets the application to assign an identifier to the object before Save() is called.
- foreign
- uses the identifier of another associated object. Usually used in conjunction with a <one-to-one> primary key association.
1.1. Hi/Lo Algorithm
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value</param>
<param name="max_lo">100</param>
</generator>
</id>
<generator class="seqhilo">
<param name="sequence">hi_value</param>
<param name="max_lo">100</param>
</generator>
</id>
1.2. UUID Hex Algorithm
<generator class="uuid.hex">
<param name="format">format_value</param>
<param name="seperator">seperator_value</param>
</generator>
</id>
1.3. UUID String Algorithm
1.3. GUID Algorithms
1.4. Identity columns and Sequences
<generator class="sequence">
<param name="sequence">uid_sequence</param>
</generator>
</id>
<generator class="identity"/>
</id>