multithreading - how to avoid multiple threads doing a merge on a single database row -


we building trading system using (jms, weblogic , oracle backend) multiple trade events create journal entries merged single position row in database table. means multiple jms consumers creating multiple journal entries contending hold of single position row update it. not scalable design because no matter how many consumers have, blocked many times while waiting lock on single oracle row. (because have few distinct positions on of activity happening).

as alternative, can keep inserting journal entries. every insert journal entry can further published event queue , consumer can call oracle view (which runs aggregate query) publish things downstream.

this 2nd solution has other issues time take compute oracle view number of journal entries keep growing on time.

is there other way can designed ?


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -