NHibernate and the Unit of Work Pattern (Part 2)

In the first part of this series I have started to implement the Unit of Work pattern.

In this post I'll finish this implementation (for non-thread safe version) and in a third post I'll discuss how to make this implementation thread safe.

Design and Implementation

The Unit Of Work Factory

The creation of a unit of work instance is a complex process and as such is a good candidate for a factory.

Since a UoW (Unit of Work) is basically a wrapper around a NHibernate session object I'll need to open such a session whenever I start a new UoW. But to be able to get such a session NHibernate has to be configured and a NHibernate Session Factory has to be available. The interface of my UoW factory is defined as follows

image

I basically have two public methods on my factory. One for the creation of the UoW and the second for the disposal of a specific UoW instance. The disposal involves also some work and thus justifies the existence of this second factory method. The 3 properties Configuration, SessionFactory and CurrentSession are there mostly for advanced scenarios (and as such could theoretically be omitted in a first simple implementation).

Let's now write the test for the Create method of the UoW factory implementation. At first I prepare a new test fixture class

using System;
using NHibernate;
using NUnit.Framework;
 
namespace NHibernateUnitOfWork.Tests
{
    [TestFixture]
    public class UnitOfWorkFactory_Fixture
    {
        private IUnitOfWorkFactory _factory;
 
        [SetUp]
        public void SetupContext()
        {
            _factory = (IUnitOfWorkFactory) Activator.CreateInstance(typeof (UnitOfWorkFactory), true);
        }
    }
}

Why the heck do I need the Activator.CreateInstance to get an instance of the factory? Well I decided that the construction of a new factory instance should be internal to the assembly implementing the Unit of Work pattern. Thus the (default) constructor of the UnitOfWorkFactory class has a modifier internal and as a consequence cannot be used from code outside the assembly in which the factory is implemented. But I need an instance when testing and thus have to resort to the technique used above.

Now the question is: "what confirms me that the method Create of the factory works as expected?". I have chosen the following: I expect

  • the method returning a non null instance of type IUnitOfWork
  • the returned instance having a non null (NHibernate) session
  • the (NHibernate) session having the Flush Mode set to commit (that is: the session is never flushed except when I explicitly commit a transaction - see the NHibernate documentation for any details about the Flush Mode)

Now the code

[Test]
public void Can_create_unit_of_work()
{
    IUnitOfWork implementor = _factory.Create(); 
    Assert.IsNotNull(implementor);
    Assert.IsNotNull(_factory.CurrentSession);
    Assert.AreEqual(FlushMode.Commit, _factory.CurrentSession.FlushMode);
}

and the implementation

public class UnitOfWorkFactory : IUnitOfWorkFactory
{
    private static ISession _currentSession;
    private ISessionFactory _sessionFactory;
 
    internal UnitOfWorkFactory()
    { }
 
    public IUnitOfWork Create()
    {
        ISession session = CreateSession();
        session.FlushMode = FlushMode.Commit;
        _currentSession = session;
        return new UnitOfWorkImplementor(this, session);
    }
}

As you can see I first need a new session instance. I then set the flush mode to commit and assign the session to an instance variable for further use. Finally I return a new instance of the UnitOfWorkImplementor (which implements the interface IUnitOfWork). The constructor of the UnitOfWorkImplementor class requires two parameters, the session and a reference to this factory.

To be able to compile I also have to define the UnitOfWorkImplementor class. Of this class I just implement the minimum needed so far

public class UnitOfWorkImplementor : IUnitOfWork
{
    private readonly IUnitOfWorkFactory _factory;
    private readonly ISession _session;
 
    public UnitOfWorkImplementor(IUnitOfWorkFactory factory, ISession session)
    {
        _factory = factory;
        _session = session;
    }
}

Now back to the implementation of the CreateSession method. To be able to create (and open) a session NHibernate must have been configured previously. So I solve this problem first.

First we add a file hibernate.cfg.xml to our test project and put the following content into it (don't forget to set the property 'Copy to Output Directory' of this file to 'Copy always').

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
    <property name="connection.connection_string">Server=(local);Database=Test;Integrated Security=SSPI;</property>
    
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>

The above configuration file assumes that you have an SQL Server 2005 installed on your local machine and that you are using integrated security to authenticate and authorize the access to the database. It further assumes that there exists a database called 'Test' on this server. To configure NHibernate for other types of databases please consult the online documentation here.

Now we define this test method

[Test]
public void Can_configure_NHibernate()
{
    var configuration = _factory.Configuration;
    Assert.IsNotNull(configuration);
    Assert.AreEqual("NHibernate.Connection.DriverConnectionProvider", 
                    configuration.Properties["connection.provider"]);
    Assert.AreEqual("NHibernate.Dialect.MsSql2005Dialect", 
                    configuration.Properties["dialect"]);
    Assert.AreEqual("NHibernate.Driver.SqlClientDriver", 
                    configuration.Properties["connection.driver_class"]);
    Assert.AreEqual("Server=(local);Database=Test;Integrated Security=SSPI;", 
                    configuration.Properties["connection.connection_string"]);
}

Here we test whether we can successfully create a configuration and whether this configuration contains the attributes we have defined via the NHibernate configuration file.

To fulfill this test we can e.g. implement the following code

public Configuration Configuration
{
    get
    {
        if (_configuration == null)
        {
            _configuration = new Configuration();
            string hibernateConfig = Default_HibernateConfig;
            //if not rooted, assume path from base directory
            if (Path.IsPathRooted(hibernateConfig) == false)
                hibernateConfig = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, hibernateConfig);
            if (File.Exists(hibernateConfig))
                _configuration.Configure(new XmlTextReader(hibernateConfig));
        }
        return _configuration;
    }
}

Note that I have defined a class variable _configuration such as that I only execute the configuration logic once during the life time of the application. Note further that in this implementation I assume that the configuration of NHibernate is defined via the hibernate.cfg.xml file which must be in the same directory as the test assembly.

As soon as I have a valid configuration I can create a NHibernate session factory. Note that this is a rather expensive operation (takes some time depending on the number of entities you are mapping) and thus should only be executed once during the life time of the application. The access to the NHibernate SessionFactory is thread safe!

Let's write a test for the creation of the SessionFactory.

[Test]
public void Can_create_and_access_session_factory()
{
    var sessionFactory = _factory.SessionFactory;
    Assert.IsNotNull(sessionFactory);
    Assert.AreEqual("NHibernate.Dialect.MsSql2005Dialect", sessionFactory.Dialect.ToString());
}

This is a rather basic test and only checks whether I can successfully create a session factory and whether at least one of its properties is configured as I expect it, namely the dialect used.

The implementation to fulfill the test is rather simple

public ISessionFactory SessionFactory
{
    get
    {
        if (_sessionFactory == null)
            _sessionFactory = Configuration.BuildSessionFactory();
        return _sessionFactory;
    }
}

I have defined a class variable _sessionFactory such that I only execute the BuildSessionFactory method once during the life time of the application. The session factory is created on demand, that is when first needed. At the same time this property getter method accesses the previously defined Configuration property which in turn triggers the configuration of NHibernate (if not already done).

The last missing piece is the implementation of the CreateSession method which now is trivial

private ISession CreateSession()
{
    return SessionFactory.OpenSession();
}
I want to be able to access the current (open) session via my factory. If there is no such session open at the moment a meaningful exception should be raised. To test this write
[Test]
public void Accessing_CurrentSession_when_no_session_open_throws()
{
    try
    {
        var session = _factory.CurrentSession;
    }
    catch (InvalidOperationException)
    { }
}

and the implementation is easy

public ISession CurrentSession
{
    get
    {
        if (_currentSession == null)
            throw new InvalidOperationException("You are not in a unit of work.");
        return _currentSession;
    }
    set { _currentSession = value; }
}

The last method to implement is the UoW disposal method. In this method I want to reset the CurrentSession to null and then forward the call to our static UnitOfWork class (defined in the first part of this post series) such as that this class can also make an internal clean-up. The implementation might look as follows

public void DisposeUnitOfWork(UnitOfWorkImplementor adapter)
{
    CurrentSession = null;
    UnitOfWork.DisposeUnitOfWork(adapter);
}

That's all we have to do for now regarding the UoW factory. Again we have implemented it in a TDD way. When we later re-factor our implementation to make it thread-safe this TDD approach will be a huge benefit since we have a complete test coverage of out code.

The Unit of Work Implementor

This class defines an actual Unit of Work instance. It implements the already mentioned (and defined) interface IUnitOfWork which in turn inherits from IDisposal. This allows us to work with a UoW using the following syntax

using(UnitOfWork.Start())
{
    // use Unit of Work
}

at the end of the block the Dispose method of the UoW will be called. So let's first think of a test for the implementation of this method. Here we have to use mocking to be able to test our SUT (system under test) in isolation. So let me setup a test fixture first.

[TestFixture]
public class UnitOfWorkImplementor_Fixture
{
    private readonly MockRepository _mocks = new MockRepository();
    private IUnitOfWorkFactory _factory;
    private ISession _session;
    private IUnitOfWorkImplementor _uow;
 
    [SetUp]
    public void SetupContext()
    {
        _factory = _mocks.DynamicMock<IUnitOfWorkFactory>();
        _session = _mocks.DynamicMock<ISession>();
    }
}

Again I use Rhino.Mocks as my mocking framework. My UoW instance has two external dependencies namely the UnitOfWork factory and the NHibernate session. In the SetupContext I generate a dynamic mock for each of them.

Now I  can write my test method

[Test]
public void Can_Dispose_UnitOfWorkImplementor()
{
    using(_mocks.Record())
    {
        Expect.Call(() => _factory.DisposeUnitOfWork(null)).IgnoreArguments();
        Expect.Call(_session.Dispose);
    }
    using (_mocks.Playback())
    {
        _uow = new UnitOfWorkImplementor(_factory, _session);
        _uow.Dispose();
    }
}

During the recording phase I define my expectations (of what should happen when calling the Dispose method of the UoW). First the DisposeUnitOfWork method of the factory and second the Dispose method of the session object should be called.

Here is the code which fulfills this test

public void Dispose()
{
    _factory.DisposeUnitOfWork(this);
    _session.Dispose();
}

As you can see I just forward the call to the Unit of Work factory and dispose my internal (NHibernate) session instance as formulated in the expectations of the test.

When working with a UoW I also have to be able to use transactions. Thus I need a way to "play" with transactions. Let's call the corresponding methods BeginTransaction and TransactionalFlush.

Generic Transaction

To shield the client code from all NHibernate specifics and to provide a simple(r) interface I define a GenericTransaction class (which implements the interface IGenericTransaction) which is just a wrapper around the NHibernate transaction.

I think that the implementation is trivial and doesn't need any further explanation

public interface IGenericTransaction : IDisposable
{
    void Commit();
    void Rollback();
}
 
public class GenericTransaction : IGenericTransaction
{
    private readonly ITransaction _transaction;
 
    public GenericTransaction(ITransaction transaction)
    {
        _transaction = transaction;
    }
 
    public void Commit()
    {
        _transaction.Commit();
    }
 
    public void Rollback()
    {
        _transaction.Rollback();
    }
 
    public void Dispose()
    {
        _transaction.Dispose();
    }
}

just note that the IGenericTransaction inherits form IDisposable.

With this definition of a generic transaction we can proceed to the implementation of the BeginTransaction and TransactionalFlush methods.

First I'll implement the BeginTransaction method. As usual I define the test first

[Test]
public void Can_BeginTransaction()
{
    using(_mocks.Record())
    {
        Expect.Call(_session.BeginTransaction()).Return(null);
    }
    using (_mocks.Playback())
    {
        _uow = new UnitOfWorkImplementor(_factory, _session);
        var transaction = _uow.BeginTransaction();
        Assert.IsNotNull(transaction);
    }
}

I expect that during execution of the method under test the BeginTransaction method of the NHibernate session is called. After calling BeginTransaction on the UoW (in the Playback phase) I additionally test whether I get a not-null transaction.

I also want to be able to start a transaction and define an isolation level for the transaction. The corresponding test might look like

[Test]
public void Can_BeginTransaction_specifying_isolation_level()
{
    var isolationLevel = IsolationLevel.Serializable;
    using(_mocks.Record())
    {   
        Expect.Call(_session.BeginTransaction(isolationLevel)).Return(null);
    }
    using (_mocks.Playback())
    {
        _uow = new UnitOfWorkImplementor(_factory, _session);
        var transaction = _uow.BeginTransaction(isolationLevel);
        Assert.IsNotNull(transaction);
    }
}

To fulfill the test(s) I just have to create a new instance of a generic transaction and pass the result of the _session.BeginTransaction call to the constructor (that is: a NHibernate ITransaction object)

public IGenericTransaction BeginTransaction()
{
    return new GenericTransaction(_session.BeginTransaction());
}
 
public IGenericTransaction BeginTransaction(IsolationLevel isolationLevel)
{
    return new GenericTransaction(_session.BeginTransaction(isolationLevel));
}

The methods each return me an instance of type GenericTransaction which I can use in my code and call their respective commit or rollback methods if appropriate.

The TransactionalFlush method should flush the content of the NHibernate session to the database wrapped inside a transaction. Let's define the test(s) for it

[Test]
public void Can_execute_TransactionalFlush()
{
    var tx = _mocks.CreateMock<ITransaction>();
    var session = _mocks.DynamicMock<ISession>();
    SetupResult.For(session.BeginTransaction(IsolationLevel.ReadCommitted)).Return(tx);
 
    _uow = _mocks.PartialMock<UnitOfWorkImplementor>(_factory, _session);
 
    using (_mocks.Record())
    {
        Expect.Call(tx.Commit);
        Expect.Call(tx.Dispose);
    }
    using (_mocks.Playback())
    {
        _uow = new UnitOfWorkImplementor(_factory, session);
        _uow.TransactionalFlush();
    }
}
 
[Test]
public void Can_execute_TransactionalFlush_specifying_isolation_level()
{
    var tx = _mocks.CreateMock<ITransaction>();
    var session = _mocks.DynamicMock<ISession>();
    SetupResult.For(session.BeginTransaction(IsolationLevel.Serializable)).Return(tx);
 
    _uow = _mocks.PartialMock<UnitOfWorkImplementor>(_factory, session);
 
    using (_mocks.Record())
    {
        Expect.Call(tx.Commit);
        Expect.Call(tx.Dispose);
    }
    using (_mocks.Playback())
    {
        _uow.TransactionalFlush(IsolationLevel.Serializable);
    }
}

and the implementation is straight forward

public void TransactionalFlush()
{
    TransactionalFlush(IsolationLevel.ReadCommitted);
}
 
public void TransactionalFlush(IsolationLevel isolationLevel)
{
    IGenericTransaction tx = BeginTransaction(isolationLevel);
    try
    {
        //forces a flush of the current unit of work
        tx.Commit();
    }
    catch
    {
        tx.Rollback();
        throw;
    }
    finally
    {
        tx.Dispose();
    }
}

Note that when you don't provide an explicit transaction isolation level our implementation automatically assumes an isolation level equal to "read commited". Note also that if the Commit of the transaction fails the transaction is rolled back.

Important: In the case of an exception during TransactionalFlush do not try to reuse the current unit of work since the session is in an inconsistent state and must be closed. Thus abandon this UoW and start a new one.

To increase the usability of the UoW instance a little bit I add the following members (which need no further explanation)

public bool IsInActiveTransaction
{
    get
    {
        return _session.Transaction.IsActive;
    }
}
 
public IUnitOfWorkFactory Factory
{
    get { return _factory; }
}
 
public ISession Session
{
    get { return _session; }
}
 
public void Flush()
{
    _session.Flush();
}

That's it! We have now a simple implementation of the Unit of Work pattern for NHibernate. Let me provide an overall picture of our implementation

image

Please remember: In this current version the UoW is strictly NOT thread-safe! But I'll show you how to make it thread-safe in the next post. 

Using the Unit of Work

In the following section I'll quickly show the typical usage of the UoW. As usual I do this via TDD. I want to demonstrate how one can define a new instance of an entity and add it to the database. In this case the entity is a simple Person type object.

Let us first set up a test fixture as follows

using System;
using System.Reflection;
using NHibernate.Tool.hbm2ddl;
using NUnit.Framework;
 
namespace NHibernateUnitOfWork.Tests
{
    [TestFixture]
    public class Test_usage_of_UnitOfWork
    {
        [SetUp]
        public void SetupContext()
        {
            UnitOfWork.Configuration.AddAssembly(Assembly.GetExecutingAssembly());
            new SchemaExport(UnitOfWork.Configuration).Execute(false, true, false, false);
        }
    }
}

In the SetupContext method I first add the current assembly (the one in which this test is running) as a source of the schema mapping information to the configuration of NHibernate (which I can access via our UnitOfWork class). It is important that this call is done prior to the creation of the SessionFactory (that is prior to using a session).

After extending the configuration I use the SchemaExport class of NHibernate to automatically generate the database schema for me.

But wait: up to now I have not defined any schema at all! So let's do it now. Let's define a simple Person entity. Add a new file Person.cs to the test project and add the following code

public class Person
{
    public virtual Guid Id { get; set; }
    public virtual string Name { get; set; }
    public virtual DateTime Birthdate { get; set; }
}

add an XML mapping document called Person.hbm.xml to the test project and define the following content

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="NHibernateUnitOfWork.Tests"
                   namespace="NHibernateUnitOfWork.Tests">
 
  <class name="Person">
    <id name="Id">
      <generator class="guid"/>
    </id>
    <property name="Name" not-null="true" length="50"/>
    <property name="Birthdate" not-null="true"/>
  </class>
</hibernate-mapping>

Don't forget to set the 'Build Action' property of this item to 'Embedded Resource'!

Now we can write a test to insert a new person instance into the database.

[Test]
public void Can_add_a_new_instance_of_an_entity_to_the_database()
{
    using(UnitOfWork.Start())
    {
        var person = new Person {Name = "John Doe", Birthdate = new DateTime(1915, 12, 15)};
        UnitOfWork.CurrentSession.Save(person);
        UnitOfWork.Current.TransactionalFlush();
    }
}

When running this test the output generated by NHibernate looks similar to this

NHibernate: INSERT INTO Person (Name, Birthdate, Id) VALUES (@p0, @p1, @p2); 
@p0 = 'John Doe', @p1 = '15.12.1915 00:00:00', 
@p2 = 'bb72ae4c-7d64-4c16-84dc-c0ba2c7d306b'

Summary

I have shown you a possible implementation of the Unit of Work pattern for NHibernate. The implementation has been developed by using TDD. The usage of a Unit of Work pattern simplifies the data manipulation tasks and hides the infrastructure details from the consumer of the UoW. NHibernate offers it's own implementation of the UoW in the form of the Session object. But NHibernate is just one of several possible ORM tools. With this implementation of the UoW pattern we have hidden most of the specifics of NHibernate an provide a generic interface to the consumer of the UoW.

There are just two open points

  • our implementation in not thread safe
  • we still need to access the session object (through UnitOfWork.CurrentSession) to read or modify our entites

The former I'll cover in my next post and the latter problem can be solved by introducing a (generic) repository which I'll also discuss in one of the next posts.

Any feedback and suggestions for improvement is welcome.

Enjoy

Blog Signature Gabriel .

Print | posted on Sunday, April 13, 2008 10:16 PM

Comments on this post

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Dude,

You're speeding. Please keep on going!
Left by redgreenrefactor on Apr 14, 2008 7:28 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
I'm enjoying the blog immensely. Perhaps when you finish the thread-safe post, you can post the solution?
Left by Rob on Apr 15, 2008 3:12 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
I'm very much enjoying your very detailed description of setting up your Unit Of Work class(es). It looks very much like my own (albeit with different names). Mine isn't thread-safe though so I'm definitely looking forward to seeing what it takes to get there.
I'm even more looking forward to your implementation of a generic repository. Still brooding on that one myself.

Please keep it up ! Thanks !!
Left by Sven on Apr 16, 2008 6:29 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Keep the good work, it is very interesting...
There are no posts since 6 days ? ? ?
Left by pduh on Apr 21, 2008 8:49 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Ya I am waiting for the next article. Keep it up Gabriel.
Left by Chua Wen Ching on Apr 24, 2008 2:21 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
@Chua: I have been at the Alt.Net conference in Seattle, sorry! And two days ago my daughter has been born... So a busy time for me. But today I have published the 3rd part of the series. Hope you enjoy it.
Left by Gabriel Schenker on Apr 26, 2008 7:16 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
@Rob: the solution is published (for the link see either part 1 or part 3)
Left by Gabriel Schenker on Apr 26, 2008 7:24 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Oh wow... I should go to the ALT.NET event since I had registered it. I missed it... i wasn't feeling well.. jetlag... flown too far ...

Good stuff. I really hope I can contribute in NHibernate space especially on 2.0 edition onwards. Support you man. Give me some time...

Congrats over your new born girl.
Left by Chua Wen Ching on Apr 26, 2008 7:58 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Could you provide working example of this solution when UnitOfWork is runned by separated thread started within web application context?
Left by dario-g on Jun 03, 2009 11:50 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
That was an inspiring post,

thanks for explaining it to us can you post more samples code for Unit of Work pattern for NHibernate please?

Thanks
Left by software development company on Aug 19, 2009 2:50 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Thank you for this nice tutorial.
Left by work at home blog on Nov 27, 2009 12:11 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Thanks for sharing such a great post
Left by Car Insurance Comparison on Dec 06, 2009 7:53 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
such a great post!
Left by pandora jewelry on Dec 24, 2009 11:53 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
I really enjoying detailed description of setting up your Unit Of Work class.
This class is equivalent to the class presented in this post on NHibernate. Once for each test session I configure ActiveRecord (and implicitly NHibernate). Before each single test I recreate the database schema to avoid any side effects leaking from one test to another.
Left by Blackjack im Internet spielen on Dec 27, 2009 6:06 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
Great tutorial although a little advanced for me as I am still at the learning stage.
Left by Chloe vans on Jan 11, 2010 2:14 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
thats just great
Left by make money online on Jan 16, 2010 1:13 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...

tiffany jewelry
Choose, buy and shop for on sale tiffany jewelry including Tiffany & Co Silver Necklace, Pendants, Bangles, Bracelets, Earrings, Rings and Accessories.
tiffany co
Tiffany Jewellery offering bangle Jewellery, bracelet jewelry, eardrop jewelry, necklace jewelry, ring jewelry, finger ring jewelry and earring jewelry
tiffany
tiffany and co
links of london
links london
Tiffany Style Silver Jewelry: Rings, Earrings, Necklaces, Bracelets and more Tiffany Jewellery at low prices.
Left by namon on Jan 24, 2010 4:17 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Left by ugg boot on Feb 08, 2010 7:20 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Left by jamea on Feb 14, 2010 9:12 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
should go to the ALT.NET event since I had registered it. I'm very much enjoying your very detailed description of setting up your Unit Of Work class(es). It looks very much like my own. Kostenlose browsergames
Left by secondeye on Feb 21, 2010 10:57 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Left by cheap picture frames on Feb 22, 2010 6:05 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Left by custom essay writing on Feb 22, 2010 10:21 PM

# Tiffany Jewelry Shop - Cheap and Discounted Tiffany Jewellery, Sterling Silver Tiffany Jewelry On Sale

Requesting Gravatar...
No matter tiffany jewelry or Gucci bracelets is a wonderful selection. How to Find Your Perfect tiffany jewelry The reasons are as the following: on the one hand,the feeling of neat lines on the jewelry are able to respond to the high quality of your professional outfits.
Left by tiffany jewelry on Feb 23, 2010 1:31 PM

# 4story Luna

Requesting Gravatar...
If you like using4story Lunato play the game which needs use4story Gold,you can borrow4story money from friends.Or you canbuy 4story Luna,and than you usecheap 4story Luna to continue the game.
Left by 4story Luna on Feb 24, 2010 1:41 PM

# discount Ugg Broome Boots in chestnut leather online sales

Requesting Gravatar...
YS0225A8 Before there was no reason in the world,As now there is!The moncler jackets course of water was my only cose,My repetitions oceans' sough and swell ugg adirondack boots!My seasons pleasurable,Before there was no reason in the world,As now there is ugg broome boots!To measure time from sleep I rose to sleep,To measure space I pastured on surprise http://www.edhardy-buy.com/,O meadows of resemblances,I was the grove on whose mosaic floors,The moncler online seeds of otherwise were spent,My gods had many arms,I was the Caesar of unmarshaled grass ugg boots!Faustus in the branches,My first ambitions were my sorrows long!Before there was no reason in the world,As now there is!
Left by discount womens moncler jacket on Feb 24, 2010 11:01 PM

# discount air jordan shoes 23 sales online

Requesting Gravatar...
YS0225A7 when the sun hugs the moon, the sky clses her eyes.when the sun hug the moon the sea quiet her jordans shoes.when the sun hugs the moon,the forest stops her susurrus.when the sun hugs the nike sb dunk high,the desert hodlds her breathe.Thousands of years's waiting is only for this nike acg shoes moment.Never be disappointed.Never give up.It hax been sucha long time.At nike air max 2003 this momentmeet each other in course of time.Do not cry,Moon.I guard you forever.Cause you are imy life,everyting has its meaning.The fascinating Diamond Ring,is the ring i give you,May it give you warm http://www.nikejordanshoes2sell.com/ threduce your tears.Do not cry,Sun,I will be there with you forever/Meeting you has given me precious memeory.The resplendent Baily Beads.is the gem i give you .May i give you cheap air jordan 22 shoes strength, shine in your morning.Meet soon and part soon.It makes peop;e retrospect in spite of lasting a few minutes.A long times waiting is coming.Don't know when the next meeting is .When the sun hugs the Moon. the Moon hugs the sun as well Hugging tightly,regian the lost nicety.
Left by discount nike air max shoes sale on Feb 24, 2010 11:05 PM

# discount air jordan shoes 25 sales online

Requesting Gravatar...
YS0225A6 When you belive,Though hope is frail.It's hard to kill,Who knows what cheap prada shoes miracles,You can achieve,When you belive! Somehow you will,

You will when you belive new nike air max!And in this time of fear, When prayer so often proves in vain, Hope seems like the http://www.nikeaf1jordanshoes.com/summer birds. Too swiftly flown away, And now I am standing wholesale gucci shoes here.My heart's so full I can't explain.Seeking faith and speaking women's nike shox words I ver thought I'd say, They don't always happen when you ask authentic air jordan shoes.And it's easy to give in to your fear. But when you're blinded by your pain!
Left by discount mens moncler down coat on Feb 24, 2010 11:09 PM

# discount ed hardy women long sleeve shirts sales online

Requesting Gravatar...
YS0225A5 If you think you are beaten, you are! If you think you dare noted hardy clothing, you don't! If you want to win but think you can't, It's almost a cinch you won't ed hardy hoodies! If you think you'll lose,you're lost! For out of the world we find.Success begins with a fellow's will,It's all in a ed hardy shirts state of mind! Life's battles don't alws go.To the stronger and faster ed hardy coats man,But sooner or later the man who wins,Is the man who thinks he can! When You Belive http://www.edfashionclothes.com/,Many night we've prayed!With no proof anyone could hear!In our heart a hopeful moncler online store song,we barely understood!Now we are not afraid !Although we know there's much to fear!We were moving the moncler jackets mountian long,Before we knew we could!There can be miracles!
Left by discount mens moncler down coat on Feb 24, 2010 11:13 PM

# gucci

Requesting Gravatar...
Onder Innovadis Groep vallen de volgende werkmaatschappijen;wholesale jordan shoes Gladior B.V. en GmbH,wholesale jordan shoes Indenty B.V.wholesale nike shoes met als kernactiviteit wholesale jordan shoeszoekmachine marketing en Innovadis B.V, wholesale jordan shoesmet als kernactiviteit het ontwikkelen en wholesale jordan shoes
implementeren van Web portalen.
Left by rita on Feb 25, 2010 2:38 PM

# discount christian louboutin sandals online sales

Requesting Gravatar...
YS0226A1 That your heart has been broken,Hear the words,I'm ere, my child,;And know your christian louboutin uk angel has spoken.For even in the darkest hour,When all of discount louboutin shoes hope seems gone,They'll give you strength to live your life,And desire to go on.And if your faith in Heaven, Should ever fade away,They'll help renew your christian louboutin boots spirit, And help you find your way.Even though you're ever filled with doubt, About the christian louboutin pumps life you live,Know that they are there to give you All that they can give.For you see, the Father sent them,Because to Him, you mean so much,That He sent them just for you,my louboutin sale friend,And your life, they will touch.They will always be here,They will never leave your http://www.christianlouboutinshoestore.com/ side;And upon their strength and guidance,You always may rely.Take comfort in their guidance, Draw strength from up above,And know that their sweet presence,Is God's precious gift of love.
Left by cheap christian louboutin shoes on Feb 25, 2010 3:35 PM

# discount women's ugg elsey boots 5596 sales online

Requesting Gravatar...
YS0226A2 If I were a boy again, I would practice perseverance more ten, and never give up a thing because it was ugg australia boots or inconvenient. If we want light, we must conquer darkness. Perseverance can sometimes equal genius cheap ugg boots in its results. “There are only two creatures,” syas a proverb, “who can surmount the pyramids—the eagle and the snail.” If I were a uggs sale boy again, I would school myself into a habit of http://www.topsnowboots.com/ attention; I would let nothing come between me and the subject in hand. I would remember that a good skater never tries to skate in two ugg cardy boots directions at once. The habit of attention becomes part of our life, if we begain early enough. I often hear cheap gucci shoes grown up people say “ I could not fix my attention on the sermon or ugg coquette book, although I wished to do so” , and the reason is, the habit was not formed in youth.
Left by cheap ugg upside boots 5163 on Feb 25, 2010 3:40 PM

# discount Women's ugg adirondack boots II sales online

Requesting Gravatar...
YS0226A3 Hold fast to dreams.For if dreams die. Life a broken-winged bird,That ugg australia boots can never fly.Hold fast to dreams. For when dreams go,Life is a barren ugg tall boots field, Frozen only with snow !You never know until you try; And you never try unless you really try ugg cardy boot. You give it your best shot; You do the best you can. And if you have done everything http://www.uggsnowbootsbest.com/! In your power,and still,The truth of the uggs argyle knit matter is! That you haven\'t failed at all.When you reach for your dreams,No matter what ugg boots they may be,You grow from the reaching;You learn from the trying;You win from the doing.
Left by cheap ugg classic cardy boots on Feb 25, 2010 3:48 PM

# discount reebok nfl jerseys online sales

Requesting Gravatar...
YS0226A4 A true friend is someone who reaches for you hand and touches your cheap hockey jerseys heart.There's always going to be people that hurt you,so what you have to do is keep on trusting nfl jerseys and just be more careful about who sport jerseys you trust next time around.Make youself a better person and know who you are discount nba jerseys before you try and know someone else and expect them to know you mlb jerseys on sale.Remember:Whatever happens,happens for a reason.How many people actually have 8 true http://www.nfljerseymlb.com/friends Hardly anyone I know.But some of us have all right friends and good friends.
Left by cheap adiads nba jerseys sale on Feb 25, 2010 3:50 PM

# discount ugg sienna miller boots 5818 sales online

Requesting Gravatar...
YS0226A9 Unwearied still, lover by lover,They paddle in the cd,Companionable ugg australia shoes streams or climb the air;Their hearts have not grown old;ugg coquette Passion or conquest, wander where they will, Attend upon them still ugg adirondack boots. But now they drift on the still water, Mysterious, beautiful; Among what http://www.uggboots4buy.com/ rushes will they build, By what lake’s edge or pool,Delight men’s mbt shoes eyes when I awake some day.To find they have flown uggs classic cardy away?Before there was no reason in the world As now there is I was the bough bent easy by a ugg boots bird I was the vague blue-grazing flock The sleeping and invisible!
Left by cheap women's ugg elsey boots on Feb 25, 2010 3:57 PM

# discount mens air jordan shoes 13 online sales

Requesting Gravatar...
YS0226A10 When you are old and gray and full of leep,And nodding by the moncler jackets fire, take down this book! And slowly read jordans sheoes , and dream of the soft look,Your eyes had once, and of their cheap nike shoes shadows deep;How many loved your moments of glad grace,And loved your beauty with nike air force 1 love false or true; But one man loved the pilgrim soul in you,And http://www.onestop-onlineshopping.com/ loved the sorrows of your changing face; And bending down beside the designer clothing glowing bars,Murmur, a little sadly, how love fled.And paced upon the mountains overhead discount air jordan shoes,And hid his face amid a crowd of stars.
Left by cheap nike air max 90 online on Feb 25, 2010 4:00 PM

# discount louis vuitton damier canvas handbags online sales

Requesting Gravatar...
YS0226A11 Surrounding you are angels,They are there to guide yur path.If designer purses weaesskn overcomes you,They'll give you strength if you will ask. They are your protection.When discount designer bags on sale life seems too hard to bear,And though you feel alone at times, The louis vuitton 2009 angels ... they are there.Their faces may be hidden And their voices you might not hear,But they are ALWAYS with you,Through your laughter or your tears.http://www.handbags4buy.com/ They'll walk along beside you,They'll guide your leather handbags steps along the way, They'll comfort you and hold you,Protect you dior handbags night and day.They'll hold to your hand tightly ,They'll not ever let it go,And they'll gently lead you cheap designer handbagsforward,Taking each step very slow.For even as you slumber,They watch closely over you;They are there beside you. In each and every thing you do.
Left by cheap nike air max 90 online on Feb 25, 2010 4:06 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...

wedding dresses,wedding gowns,bride dresses,bridesmaids dresses,evening dresses,bridal gowns,flower girl dresses
Wedding Gowns
Formal Gowns
Cocktail Gowns
Find the wedding dress designer and wedding dress that's right for you! Browse dresses from
Bridesmaid Gowns
Evening Gowns
View our selection of exquisite, handmade gowns and dresses for your wedding
Wedding Dresses, Wedding Shoes and Wedding Accessories from wedding shop, the UK's finest collection of designer wedding dresses.
Use the wedding dress and
cheap wedding
wedding dresses
wedding shop
ds
Left by sbb on Feb 27, 2010 10:11 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
I will bookmark your website to check out if you publish more in the future.
Left by ucvhost on Mar 06, 2010 2:48 AM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Left by deb on Mar 06, 2010 7:53 AM

# ugg boots

Requesting Gravatar...


they are very good and useful!!!
ugg outlet
cheap uggs
nike shoes
wholesale watches y
Left by ugg boots on Mar 07, 2010 5:28 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks Don’t stop writing, you’ve given me lots of good info! Youtube to MP4 Converter
Convert PDF to image
f3sr
Left by powerpoint on Mar 08, 2010 2:24 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
, the active and energetic style with the roll of the direction in the opposite direction can be made similarly with the

formal procedure. All you need to do is to roll the hair outward instead of inward with GHD hair straightener.
It is so simple that you can have your ownMy hair is just over my ears. I like two kinds of hair styles most. Firstly, use the ghd straighteners to make

the hair in nature and bouffant style. Divide the hair into several portions. Use ghd pink to roll them inside

towards your ears. Several minutes later, the hair will roll neatly inside in the branches. Secondly, the active and energetic style with the roll of the

direction in the opposite direction can be made similarly with the formal procedure. All you need to do is to roll the hair outward instead of inward

with ghd mk5.
It is so simple that you can have your own charming short hair style with GHD straightener uk. Besides the new hair styles,ghd straighteners can help you with the puffy hair after you get up which is the annoying thing for many short hair

girls.
So as long as I have the good tool of ghd pink, no matter what the fashion trend goes of hair styles, I will

stick into my favorite neat short hair.
Left by ghd straighteners on Mar 09, 2010 3:32 PM

# re: NHibernate and the Unit of Work Pattern (Part 2)

Requesting Gravatar...
I'm only regretting that I didn't buy one earlier.I'm only regretting that I didn't buy one earlier.Whenever I hear friends talking about mbt, my feeling would always be a painful mixture of envy and

helplessness. As a matter of fact, I have long been craving about possessing a pair of MBT shoes. To a girl of low stature as me, a pair of mbt shoes could make me seem more slender or least won't be dwarfed by other girls. But its high price always

makes me feel hard to afford due to my restrained financial conditions.
But not long ago, a friend of mine sent me a pair of mbt shoes sale which thrilled me up for several days.

It's not until then that did I realize each penny for it is well paid. Indeed, it really deserves such a high price. I'm only regretting that I didn't

buy one earlier.
Left by ghd pink on Mar 09, 2010 3:39 PM

Your comment:

 (will show your gravatar)
 
Please add 4 and 2 and type the answer here: