NHibernate Forge
The official new home for the NHibernate for .NET community

Comments: NHibernate concurrency with Oracle's ORA_ROWSCN

Wiki Page Hierarchy

Pages

Page Details

First published by:
JuanCho
on 04-29-2009
Last revision by:
JuanCho
on 06-03-2009
This page has not yet been rated
Comments (3)
History (5)

NHibernate concurrency with Oracle's ORA_ROWSCN

Sort by: Published Date | Most Recent | Most Useful
By: gmason Posted on 05-12-2009 13:27

Does this work with NH 2.2?  I'm getting schema validation errors with the 2.1 example.

By: gmason Posted on 05-13-2009 13:41

Sorry, it was my mistake - had the <version> in the wrong place.  I now have this working, but if I try to use it with dynamic insert / update, when I update a column the generated SQL tries to update the version column (ORA_ROWSCN) and fails.

By: JuanCho Posted on 06-03-2009 9:51

gmason, I'm revisting the topic since I started seeing some odd behavior as well. It turns out that ORA_ROWSCN gets updated on commit.

So, if within a transaction, you insert a record, nhibernate will go and retrieve the value of the version column (ORA_ROWSCN in this case). The problem is that the value is wrong!, in order to get the correct value, the entity should be refreshed (re-read from db) after the commit, once the whole transaction has ended. It seems to be the oracle way...

Powered by Community Server (Commercial Edition), by Telligent Systems