java - Is there a good patterns for distributed software and one backend database for this problem? -


i'm looking high level answer, here specifics in case helps, i'm deploying j2ee app cluster in weblogic. there's 1 oracle database @ backend.

a normal flow of app is
- users feed data (to inserted rows) app
- app waits data reach size , batch insert database (only 1 commit)

there's constraint in database preventing "duplicate" data insertions. if app gets constraint violation, have rollback , re-insert 1 row @ time, duplicate rows can "renamed" , inserted.

suppose had 2 running instances of app. each of instances insert 1000 rows. if there 1 duplicate, 1 instance have rollback , insert rows 1 one.

i can see smarter re-insert non-conflicting 999 rows batch in instance, if had 3 running apps , 999 rows had chance of duplicates?

so question this: there design pattern kind of situation?

this long question, please let me know clarify. thank time.

edit: 1000 rows of data in memory each instance, cannot see rows of each other. way know if row duplicate when it's inserted database.

and if current application design doesn't make sense, feel free suggest better ways of tackling problem. appreciate much.

http://www.oracle-developer.net/display.php?id=329


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -