Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Java + Oracle data syncronization ?

Re: Java + Oracle data syncronization ?

From: Alex Filonov <afilonov_at_pro-ns.net>
Date: Fri, 05 Jan 2001 05:02:56 GMT
Message-ID: <933kht$o4a$1@nnrp1.deja.com>

Once you update the row (execute update statement), it is locked. So user Two won't be able to update the same row until user One issues commit or rollback. Oracle doesn't let you to update record which is being updated by another user. You can also explicitly lock row using select for update statement (same select you use to get the row with for update clause in the end). Now the fun part. Some people want to force user to reread the record if it was updated by another user and commited. That prevents from using old copy of row columns to update a new copy of row. This can be achieved by using serializable transactions. But to use this option you'd better read documentation first (carefully).

In article <3A55341B.48E5AE7D_at_mimos.my>,   Christopher <sc_toh_at_mimos.my> wrote:
> Hi all,
> I am developing JSP, JavaBean and Servlet with Oracle database. I
 have
> problem in syncronize the data. For example, when UserOne updating
 the
> Entry A, (within the time of fetch() and update()) there are UserTwo
> wana to update Entry A at the same time ( in the sequence of
> UserOne.fetch() ->UserTwo.fetch() ->UserOne.update()
 ->UserTwo.update()
> ). This cause the data is not syncronized. Theoritically, I know we
 need
> to lock it but how to do it ? In programming level or database level
 ?
>
> Thanks in advance,
> Christopher
>
>

Sent via Deja.com
http://www.deja.com/ Received on Thu Jan 04 2001 - 23:02:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US