SyncResolver.UPDATE_ROW_CONFLICT

Hi,

I am using DataProvider on each page and their cachedRowSet is normally defined in SessionBean.

And same cachedRowSet from SessionBean is used in number of pages.

General setting for cachedRowSet is:

concurrency: CONCUR_UPDATABLE

transactionIsolation: TRANSACTION_READ_COMMITTED

On occasion, I get error when update is issued:

Number of conflictswhile synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0 attempt to update a row that has been updated or deleted by another user.

Any suggestions to solve this issue?

Thanks.

[625 byte] By [ndzpaca] at [2007-11-27 5:29:54]
# 1

Hi,

Cached row sets are not thread safe, so if multiple users can access them simultaneously then you should provide some methods of synchronization for example

// in application bean create lock object like this:

public final Object lock = new Object();

private void method() {

// ..

ApplicationBean1 ab1 = getApplicationBean1();

synchronized(ab1.lock) {

//do data provider operations here

dataProvider.commitChanges();

}

//..

}

Also you could add dataProvider.refresh() into prerender() method, so row sets will be updated while loading page.

regards

Grzegorz

Grzegorz.Kluczeka at 2007-7-12 14:53:29 > top of Java-index,Development Tools,Java Tools...
# 2

Thanks for the info Grzegorz.

Cached Row Sets are in session bean so I guess that for each user there will be a separate instance of row set as per session so there should not be simultaneous access, isn't it?

Yes, I do call refresh in prerender. And the strange part is, once that error occurs, even I close browser and access that page again I still see that error.

ndzpaca at 2007-7-12 14:53:29 > top of Java-index,Development Tools,Java Tools...