nhibernate-patterns

Provide NHibernate patterns for session management, schema evolution, and bulk operations.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/MudraMartin/dotlight-skillset --skill nhibernate-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nhibernate-patterns
Source: https://github.com/MudraMartin/dotlight-skillset/tree/main/dotnet/nhibernate-patterns
Command: npx skills add https://github.com/MudraMartin/dotlight-skillset --skill nhibernate-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps .NET developers optimize NHibernate data access by providing tailored patterns for efficient session management, schema evolution, and bulk operations.

Core Features & Use Cases

  • Session Management: Offers patterns for handling session lifecycle, including session-per-request DI and managing ISession and IStatelessSession.
  • Schema Evolution: Provides guidance on schema evolution without EF migrations, using tools like FluentMigrator and DbUp.
  • Bulk Operations: Optimizes bulk DML operations for performance, handling identity generation and batching.
  • Use Case: Ideal for developers looking to improve the performance and scalability of NHibernate-based applications, especially for bulk data operations and schema evolution.

Quick Start

Apply the nhibernate-patterns skill to your NHibernate project to implement best practices for session management and schema evolution.

Frequently Asked Questions about nhibernate-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage NHibernate session lifecycle in a .NET web application?

NHibernate session management uses patterns like session-per-request dependency injection to handle ISession and IStatelessSession lifecycles, improving performance and maintainability for .NET applications.

What is the best way to handle database schema evolution without Entity Framework migrations?

Schema evolution without EF migrations is handled using tools like FluentMigrator and DbUp, which provide structured database versioning and script deployment for .NET applications.

How do I optimize NHibernate bulk DML operations for high performance?

Optimizing NHibernate bulk operations requires patterns that handle identity generation and batching efficiently, reducing overhead for large-scale data modifications in .NET applications.

When should I use IStatelessSession instead of ISession in NHibernate?

Use IStatelessSession for bulk operations where tracking is unnecessary, while ISession handles standard session-per-request scenarios requiring change tracking and persistence context management.

Can I use FluentMigrator with NHibernate for database schema changes?

Yes, FluentMigrator works with NHibernate to provide schema evolution capabilities without EF migrations, enabling structured database versioning alongside NHibernate data access patterns in .NET projects.

Why does NHibernate bulk insert performance degrade with identity generation?

NHibernate bulk insert performance degrades because identity generation requires database round-trips per row, bypassing batching; optimized patterns address this by managing identity generation and batching differently.