Hi,
In my unreferenced(),the lockRecords keep a set of locked records in each remote connection object
public void unreferenced() {
System.out.println("Unreferenced called");
// the LockManager and lockRecords free all the locks and keys
Iterator iter = lockRecords.iterator();
while (iter.hasNext()) {
int record = ((Integer) iter.next()).intValue(); // line 298
unlock(record);
lockRecords.remove(new Integer(record));
}
}
It throws
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
at java.util.HashMap$KeyIterator.next(HashMap.java:798)
at suncertify.server.RemoteAccess.unreferenced(RemoteAccess.java:298)
at sun.rmi.transport.Target$1.run(Target.java:321)
at java.lang.Thread.run(Thread.java:536)
Could someone tell me why and how to handle it?
Thanks!