java - Synchronize multiple weblogic database access -
we have multiple instances of weblogic running on server. these instances access single database.
one of table stores requests need process. issue more 1 weblogic can access database @ given time , can pick request , process it. due 1 request gets processed multiple times & creates issues.
these no use of creating attribute in db stores flag whether record processed or not 2 weblogic can access record in same time.
the code access database java, no use of making part synchronized as, each weblogic has there separate copy of code.
please suggest how can make sure 1 record gets processed 1 time multiple running weblogics.
well, answer depends upon, how accessing db, using api hibernate or simple jdbc. 1 thing can is, can manage thru session. once record accessed, becomes dirty
, hence not accessed next time. surely need add mechanism how ever can let application know that, "which requests processed , not".
2 weblogic can access record in same time.
this seems horrible me, that, need ensure atomicity sure. guess, (not sure) when 1 web logic accesses it, occupy lock on transaction. web logic should have fresh copy of same record, indeed after releasing lock).
hope helps.
Comments
Post a Comment