Synchnoized for update db and refresh/update

UI Components for JSF
Post Reply
samwun9988
Posts: 69
Joined: 22 Jan 2011, 11:04

04 Mar 2011, 00:31

Hello

I think all my previous related update/refresh issue is related to the two operation - fetch data from DB and refresh, are not synchonized.

eg.

Code: Select all

public void createRole() {
     roleManager.createRole(getRoleName());
     getNumberOfRecordsFromDB();  // for refresh local / datatable list.
}
I found that the above createRole() function in deed have created a new role in database through web service call, but getNumberOfRecordsfromDB() getting the incorrect recordCount, that means the record count is unchanged after roleManger inserted a new role into db.

I wonder if synchonized can resolve this issue.
eg.

Code: Select all

public synchonized void createRole() {
     roleManager.createRole(getRoleName());
     getNumberOfRecordsFromDB();  // for refresh local / datatable list.
}
Thanks a lot
Sam
Primefaces 2.2.1, JBOSS 6.0.0.Final, JDK1.6

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests