sql - ORA-00001: unique constraint: 1node vs 3node -


we're using oracle 11.2.0.3.0, configured 3 node rac.

in our application have hibernate on ucp , ojdbc compatible version rac. hibernate use sequence id record in database. database we've got table unique_constraint (some_value) on it. it's used synchronized many instance of application, every transaction in application requires unique row in table. application tries insert in table (some_value="a"), if other application inserted row (some_value="a"), first instance ora-00001 unique constrain violated, , retry other value (some_value="b").

unique_constraint fires often. 1 in 8tx.

we run 2 tests:

service pinned 1 node: response time avg 6ms service on 3 nodes: response time avg 800-1000ms 

high level question why? happening in 3 node rac when unique_constraint occurs, , why it's slowing down application. how can diagnose case?

michal

use service level scaling on rac. create "loader" service rac side. make service active on 1 node only. , let hibernate use these service "loader" connections loads.

the explanation - vague - each cluster node mastering subset of database's address space. when using unique constraint, each node must request data blocks of unique index it's mastering node. when duplicit key found , both duplicit keys inserted via transactions not commited yet. oracle has enqueue 1 session , let wait till other session(belonging node) commits or rollbacks.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -