Oracle RowDependencies

Posts   
 
    
happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 04-Dec-2008 06:35:38   

In searching the forums, I'm a bit confused. It seems there's no optimistic concurrency checking by default. In reading the docs, I can override save and send the list of fields for it to check

I would like to make use of oracle's rowdependencies feature, ORA_ROWSCN. Is there any internal support or sample code for doing it this way?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 04-Dec-2008 11:43:41   

It seems there's no optimistic concurrency checking by default.

Concurrency control is something that can be implemented in various ways. Because there are numerous ways to implement concurrency control (abstract concurrency control using functionality locking, low level concurrency schemes with optimistic locking or pessimistic locking, all fields filters, timestamp filters etc.), the generated code offers you the tools to produce the concurrency scheme you want. To implement low level concurrency control like optimistic locking, predicates are used to limit the scope of a query executed. These predicates are added to the query being executed.

To produce these predicates automatically, it's wise to implement IConcurrencyPredicateFactory for the class(es) you want concurrency control for. See the sections about concurrency control (Selfservicing & Adapter)

ORA_ROWSCN is just a column that track changes (holds a system number for the last change done on the row), there is no built in support for it. But you can always use your own Timestamp column for the same purpose, tracking the last modified dateTime of the row.