Tips and Tricks in a world of Mix

Posts tagged ‘Transaction.IsolationLevel.ReadCommited’

Fluent Nhibernate configuring OptimistickLock.Dirty() with Transaction.IsolationLevel.ReadCommited when the row locked in Oracle 10g

The problem is :
I have a working system with FluentNhibernate.
I have a legacy database and it’s hybrid system which suppose to give an answer to a new and old systems as one. So that means I couldn’t use the Version – which means at this point to change the schema and add column to each table.

I’ve added OptimistickLock.Dirty() with Transaction.IsolationLevel.ReadCommited() to deal with the problem of locking .
The trouble is that when the row locked in Oracle 10g and I am trying to SaveOrUpdate the entity it just stops the application.

Then , when I save or rollback in Oracle the Application gets the process back and throws the exception NHibernate.StaleObjectStateException that is being handled in my exception handler which is fine.

The question is how to make the application to recognize on the spot that there is a lock on the current row I am trying to access and throw the adequate exception .

Advertisements

Tag Cloud

%d bloggers like this: